A terminal-side conditional resource metering method, device, and storage medium for target scenarios.

By identifying runtime state events of terminal devices and activating or pausing metering of controlled resources, the problem of distinguishing different scenarios within the same application and handling complex transition states is solved, achieving refined and verifiable metering results.

CN122496437APending Publication Date: 2026-07-31HANZHONG BIG FRUIT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANZHONG BIG FRUIT TECHNOLOGY CO LTD
Filing Date
2026-05-10
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies struggle to differentiate between different business scenarios within the same application on terminal devices and handle complex transition states, resulting in inaccurate measurement results and a lack of verifiability.

Method used

By acquiring multiple runtime state events from the terminal device, it can identify whether the current context matches the target scenario, and activate the metering of the controlled resources when it matches, and pause or exit the metering under transition or exclusion conditions to form a structured metering result object.

Benefits of technology

It enables refined and conditional measurement of controlled resources in complex scenarios, improves the accuracy and verifiability of measurement results, reduces the probability of mismeasurement, and generates interpretable measurement results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122496437A_ABST
    Figure CN122496437A_ABST
Patent Text Reader

Abstract

This invention discloses a terminal-side conditional resource metering method, device, and storage medium for target scenarios. The method includes: acquiring multiple runtime state events on the terminal device; locally on the terminal device, identifying whether the current terminal context matches the target scenario based on the events; when the target scenario is matched, activating metering of controlled resources; when the target scenario is not matched, or when transition conditions or exclusion conditions are met, pausing, exiting, or correcting the metering; forming multiple active match segments based on the match status changes of the current terminal context, determining the metering result corresponding to the target scenario based on the match segments, and outputting the metering result. This invention can distinguish different business scenarios within the same application, achieve fine-grained resource metering at the target scenario level, and uniformly process complex transition states, reducing erroneous metering in non-target segments, and making the metering results traceable and verifiable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of terminal-side usage behavior analysis, resource metering, and scenario-based control technology, and particularly to a terminal-side conditional resource metering method, device, and storage medium for target scenarios.

[0002] In some embodiments, the present invention can also be applied to the technical fields of terminal behavior recognition, usage time measurement, scenario-based resource management, local conditional settlement, intelligent agent task measurement, and embodied task responsibility measurement. The present invention aims to: determine whether controlled resources should be included in measurement on the terminal side based on the target scenario hit result, and to perform pause, exit, or correction processing on measurement in scenarios where the target scenario is not hit, in transitional scenarios, or in excluded scenarios.

[0003] In some extended embodiments, the target scenario may also correspond to other business directions, and the corresponding technical solutions can form a complete processing chain around observable input, target scenario hit determination, controlled resource objects, non-hit segment processing, and structured result output. This facilitates implementation by those skilled in the art and allows for adaptation to equivalent applications in different fields without departing from the technical essence of the invention. Background Technology

[0004] As business models such as content consumption, interactive entertainment, authorization control, family management, and risk identification continue to emerge in terminal devices, more and more product demands are no longer satisfied with coarse-grained duration statistics for the entire device, application, or page. Instead, they want to perform metering, deduction, accumulation, write-off, settlement, or other equivalent resource change processing on a certain type of controlled resource only when specific business scenarios actually occur.

[0005] In existing technologies, terminal-side time statistics are typically based on application startup / exit, page opening / closing, or foreground / background switching, yielding total application usage time, page dwell time, or simple effective time. While this approach can reflect user usage to some extent, it usually suffers from the following problems: 1. Difficulty in distinguishing different business scenarios within the same application. Within the same application, main consumption scenarios, intermediate transition scenarios, customer service assistance scenarios, payment confirmation scenarios, and advertising display scenarios often coexist. Existing solutions tend to include different segments together, making it difficult to perform precise measurement only for the target scenario.

[0006] 2. Difficulty in handling complex transition states. Short-term background switching, system-level pop-ups, split screens, small windows, floating window obstruction, external page jumps, abnormal jumps, and other states frequently occur in real-world use. However, ordinary start and end time statistics cannot reliably distinguish which segments should continue to be associated and which segments should be paused or excluded.

[0007] 3. The output results are usually only the total duration value, lacking a structured representation of the measurement basis, segment boundaries and exclusion reasons, which is not conducive to review, auditing, dispute resolution or platform collaboration.

[0008] Another type of existing technology attempts to accumulate valid duration when certain conditions are met, but its processing method is usually still based on the start and end of an interval. The focus is on judging whether a certain period of time meets the conditions, but it lacks a unified processing of the relationship between target scenario hit, transition conditions, exclusion conditions, and correction conditions. When facing intermediate processes, multiple short-term interruptions, or multiple service state switching within the same application, it is still easy to cause mismeasurement or missed measurement.

[0009] Another category of technologies focuses on scene recognition, addiction scoring, risk scoring, early warning signals, or control strategy generation. The output of these technologies typically emphasizes labels, scores, levels, alarms, or intervention actions, rather than actionable measurement results for controlled resources. Identifying scene labels, outputting scores, or generating control strategies does not equate to completing resource metering for the target scene.

[0010] Therefore, existing technologies still lack a technical solution that can perform refined, conditional, and correctable measurement of controlled resources on the terminal side based on target scenario hits, and maintain the accuracy and verifiability of measurement results under complex transition states.

[0011] The technical problem to be solved by this invention is: how to perform conditional metering of controlled resources on the terminal side based on target scenario hits, and to uniformly process metering entry, pause, exit and correction under short-term interruption, intermediate process, exclusion process and complex transition state, so as to form metering results that are more consistent with the actual target scenario consumption and are verifiable.

[0012] In specific business operations, such requirements can manifest in different forms, such as "deducting the quota only when consumption is allowed", "accumulating resource usage only when the task is active", "revoking the quota only when authorized content is enabled", and "confirming resource changes only when settlement is possible". However, the underlying technical essence of these business rules is still to control whether resources are included in the metering based on whether the target scenario is hit, and to suppress, suspend, exclude, cancel, return or correct the corresponding metering results in the non-hit area. Summary of the Invention

[0013] 3.1 Purpose of the Invention To address the problems of existing technologies in distinguishing different scenarios within the same application, handling complex transition states, and forming verifiable measurement conclusions, this invention provides a terminal-side conditional resource measurement method, device, and storage medium for target scenarios.

[0014] 3.2 Technical Solution This invention provides a terminal-side conditional resource metering method for a target scenario, comprising: S101, acquire multiple runtime state events on the terminal device; S102, on the local terminal device, based on the plurality of runtime state events, it is identified whether the current terminal context matches the target scene; S103, when it is identified that the current terminal context hits the target scenario, the metering of the controlled resources is activated; S104, when it is identified that the current terminal context does not match the target scenario, or the current terminal context meets the transition condition or exclusion condition, the metering of the controlled resource is paused, exited or corrected. S105, based on the hit state change of the current terminal context, multiple hit segments in an active state are formed, and based on the multiple hit segments, the measurement result corresponding to the target scene is determined and the measurement result is output.

[0015] Optionally, the target scenario is defined by at least two of the following: target application identifier, target page level, target page progression stage, target interaction type, target display form, and target retention condition; the hit identification of the target scenario is premised on the simultaneous satisfaction of the aforementioned at least two defining conditions.

[0016] Optionally, the runtime state events include at least one of the following: application startup event, page entry event, page advancement event, interaction confirmation event, foreground / background switching event, split-screen state event, floating window state event, screen on / off state event, system pop-up event, and excluded page event.

[0017] Optionally, when it is identified that the current terminal context meets the hit condition but does not meet the exclusion condition, the metering state is switched to the active state; when it is identified that the current terminal context meets the transition condition or the exclusion condition, the metering state is switched to the paused state; when it is identified that the current terminal context no longer meets the hold condition corresponding to the target scenario, the metering state is switched to the exit state; and when the hit condition is met again after the paused state, the metering state is switched back to the active state.

[0018] Optionally, the measurement result is obtained by: determining the corresponding segment measurement value based on multiple active hit segments; accumulating the multiple segment measurement values ​​and combining the effects of paused segments, excluded segments, and / or corrected segments on the measurement process to determine the measurement result; wherein, the paused segments and the excluded segments are not included in the accumulation as measurable hit segments, and the corrected segments are used to adjust at least one of the following: segment boundaries, accumulation start and end, or accumulation result.

[0019] Optionally, the transition conditions include at least one of the following: short-term foreground / background switching, system-level pop-up interruption, stay on a non-target intermediate page, abnormal page bounce, split-screen display switching, and floating window obstruction; wherein, the non-target intermediate page may correspond to an intermediate transition state, an auxiliary process state, or other non-target active state, and in some embodiments includes at least one of a login page, an advertising page, a payment page, or a customer service page.

[0020] Optionally, when a short-term foreground / background switch and / or system-level pop-up interruption is detected, and the retention condition corresponding to the target scenario is met again within a preset recovery threshold, the hit segments before and after the interruption are correlated, and the interruption interval is marked as a pause segment or a correction segment.

[0021] Optionally, the method further includes: generating a structured measurement result object based on the measurement result; the structured measurement result object includes at least two layers: a fragment layer, a summary layer, a basis layer, and an index or validation field layer.

[0022] The present invention also provides a terminal device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0023] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.

[0024] 3.3 Technology Action Chain The technical effect of this invention is not a simple parallel arrangement of several conventional steps, but is achieved through the synergistic effect of the following technical action chain: 1. Multiple runtime state events are used to form the current terminal context; 2. The current terminal context is used to determine whether the target scene has been hit; 3. Target scenario hit determination is used to decide whether the controlled resource should be included in the metering; 4. Transitional conditions, exclusion conditions, and correction processes are used to suppress erroneous measurements in non-target sections; 5. Hit state changes and hit segments are used to form interpretable measurement results; 6. Structured measurement result objects are used to carry measurement conclusions and their basis.

[0025] 3.4 Beneficial Effects Compared with the prior art, the present invention has at least the following beneficial effects: 1. Compared to ordinary application usage time statistics or page dwell time statistics, this invention can distinguish different business usage states within the same application, and achieve refined resource metering at the target scenario level.

[0026] 2. Compared with the cumulative scheme that only relies on the start and end of the interval or the switching between the front and back ends, the present invention can uniformly handle the transition conditions, exclusion conditions and correction conditions, thereby reducing the probability of non-target segments being mistakenly included.

[0027] 3. Compared with solutions that only perform scene recognition, scoring and warning or policy control, the present invention directly produces measurement results for controlled resources, which can be used for deduction, accumulation, write-off, settlement or other resource changes.

[0028] 4. Compared with the scheme that only outputs the total duration value, the present invention can also generate structured measurement result objects, so that the measurement results have the ability to be traceable, verifiable, interpretable and collaborative.

[0029] 5. Compared with schemes that use only a single identification condition or a single start-stop interval for calculation, this invention improves the consistency between the measurement results and the actual consumption of the target scene through joint limitation of the target scene, transition / exclusion processing and correction mechanism.

[0030] 6. Compared with schemes that only perform real-time deductions or only perform ex-post statistics, this invention allows real-time metering, delayed settlement, and correction processing to work together under the same technical framework, thereby improving the stability of implementation and the interpretability of results in complex scenarios.

[0031] Furthermore, the aforementioned technical effects are not simply isolated combinations or superpositions of individual technical features, but rather achieved through the synergistic effects of target scene hit identification, transition / exclusion condition processing, correction processing, hit segment accumulation, and structured measurement result objects. Specifically, target scene hit identification defines which segments are included in the measurement; transition / exclusion condition processing and correction processing suppress erroneous measurement of non-target segments; hit segment accumulation generates results corresponding to the target scene; and structured measurement result objects carry these results and their supporting evidence, thus collectively achieving refined conditional measurement in complex scenarios.

[0032] 3.5 Problem-Method-Effect Correspondence Unable to distinguish different business states within the same application The target scenario is defined by multiple conditions. Achieve fine-grained differentiation at the target scene level Difficult to handle complex transition states and intermediate processes Unified handling of transitional conditions, exclusion conditions, and correction conditions Reduce intermediate process mismeasurement It is difficult to determine whether the period before and after a short interruption belongs to the same measurement continuum. Introducing recovery threshold and fragment association mechanism Improve the continuity and stability of measurement under complex usage processes Only the total duration statistics can be obtained. Hit fragments are generated and accumulated based on changes in hit state. Forming measurement results oriented towards resource settlement. It's difficult to explain why certain sections were included or excluded. Generate structured econometric results objects Facilitates review, dispute resolution, and platform collaboration Attached Figure Description

[0033] Figure 1 This is a schematic diagram of the overall process of the present invention; Figure 2 A schematic diagram illustrating the switching of target scene hit recognition and measurement states; Figure 3 This diagram illustrates the relationship between hit segments, paused segments, excluded segments, and corrected segments. Figure 4 A schematic diagram of the structured measurement results object; Figure 5Flowchart for a typical terminal scenario implementation; Figure 6 This is a block diagram of the terminal device structure. Figure 7 A schematic diagram illustrating a target scenario constrained by multiple conditions; Figure 8 This diagram illustrates the correlation between segments before and after the interruption, based on the recovery threshold.

[0034] The accompanying drawings are for illustrative purposes only and do not constitute a limitation on the scope of protection of this invention. Detailed Implementation

[0035] The technical solution of the present invention will be further described below with reference to embodiments thereof. It should be understood that the following embodiments are for illustrative purposes only and are not intended to limit the present invention. For those skilled in the art, various changes, substitutions and modifications can be made without departing from the spirit and scope of the present invention.

[0036] 5.1 Terminology Definition 5.1.1 Target Scenarios In this invention, the target scenario refers to the service usage state related to controlled resource metering, which is jointly defined by one or more terminal context conditions.

[0037] The target scenario is a technical concept defined by the runtime state that can be objectively obtained, automatically identified, or determined by the terminal device, and is not solely determined by the user's subjective intent, business name, or product naming. Only when the preset state conditions meet the predetermined relationship is the current terminal context considered to have hit the target scenario, thereby triggering the activation, suspension, exit, or correction of subsequent resource metering.

[0038] The target scenario is not equivalent to a single application, a single page, or a single interface label. Preferably, the target scenario can be defined by at least two of the following: target application identifier, target page hierarchy, target page progression stage, target interaction type, target display format, and target retention conditions.

[0039] The target retention condition refers to a state constraint that characterizes the current terminal context maintaining the target scenario for a continuous period of time. In some embodiments, the target retention condition may consist of continuously being at the target page level, continuously being in the target page progression stage, continuously maintaining the target display form, continuously satisfying the target interactive activity characteristics, or a combination thereof.

[0040] The determination of the target scene hit can be accomplished by positive recognition that the target conditions are met, or by excluding non-target conditions, screening out the metered allowable state, or by comparing candidate scenes. As long as a determination is ultimately made on whether the current terminal context belongs to the target scene, it falls under the target scene hit recognition described in this invention.

[0041] In different embodiments, the "target scenario" can also be described as a target task state, target mode, target content consumption state, target session state, target authorization state, metering permission state, settlement state, or other equivalent names. As long as it is essentially used to limit whether the controlled resource should be metered, it can be regarded as an equivalent expression of the target scenario described in this invention.

[0042] 5.1.2 Terminal Context Terminal context refers to the combination of runtime states of a terminal device at the current moment that are related to scene recognition and resource metering.

[0043] The terminal context includes, but is not limited to: foreground application state, page entry state, page progression state, user interaction state, screen state, split-screen state, floating window state, system pop-up state, page exclusion state, etc.

[0044] The terminal context is not required to contain all state elements at any given time, but can be a combination of one or more state elements required for the current decision.

[0045] 5.1.3 Controlled Resources Controlled resources refer to resources that require consumption recording, quota deduction, quota settlement, availability statistics, or other resource change processing based on the hit status of the target scenario.

[0046] The controlled resources include, but are not limited to: available time, temporary authorization quota, scene access quota, usage license quota, risk exposure time quota, task execution quota, action invocation quota, remote takeover quota, inference invocation budget, or other resources that can be conditionally measured.

[0047] The measurement results of the controlled resources can be expressed as the increase in duration, the deduction of quota, the change in remaining quota, or as the intermediate measurement value or structured record on which subsequent settlement is based.

[0048] In different embodiments, the controlled resource can also be described as available quantity, quota, budget, authorized limit, equity limit, access limit, usage credit, or other equivalent resource forms. As long as its change is driven by whether the target scenario is hit or not, it can be considered a controlled resource according to the present invention.

[0049] 5.1.4 Transitional Conditions Transitional conditions refer to intermediate states where the terminal context temporarily deviates from the target scenario but is not yet sufficient to directly end the metering continuum.

[0050] The transition conditions may include short-term foreground / background switching, system-level pop-up interruption, split-screen switching, small window or floating window obstruction, and dwelling on a non-target intermediate page. In some embodiments, the terminal device is not required to explicitly identify each specific page type, but can divide the current terminal context into a target consumption state, a non-target active state, and an intermediate reception state based on at least one observable signal among the foreground active application state, network traffic characteristics, target service identification characteristics, and interactive activity characteristics; wherein, the intermediate reception state can be used as one type of implementation of the transition conditions.

[0051] In some embodiments, if an interrupted segment meets the hit condition again within a preset recovery threshold and can be associated with the metering process before and after the interruption as the same continuum, the corresponding state is preferentially identified as a transition condition.

[0052] In different embodiments, the transition condition can also be described as an intermediate state, a buffer state, a suspended state, a state awaiting confirmation, a temporary deviation state, or other equivalent names. As long as the state is insufficient to directly confirm that the corresponding segment should be used as a valid measurement segment of the target scene, it can be included in the transition condition described in this invention.

[0053] The distinction between transitional conditions and exclusion conditions can be made using the following objective criteria: if the corresponding segment, after meeting the hit condition again within the recovery threshold, may still be associated with the target scene measurement process before and after the interruption as part of the same continuum, it is preferentially identified as a transitional condition; if the corresponding segment should not be included in the target scene measurement regardless of whether it is within the recovery threshold, it is preferentially identified as an exclusion condition.

[0054] 5.1.5 Exclusion Conditions Exclusion criteria refer to the state where the current terminal context, although partially related to the target scenario, should not be included in resource metering.

[0055] The exclusion criteria may include non-target active states, auxiliary process states, external confirmation states, abnormal bounce pages, or other segments that should not be used as the basis for target scenario measurement. In some embodiments, the exclusion criteria may be further refined to login pages, advertising pages, payment pages, customer service pages, or other specific business pages; in other embodiments, even if specific page names are not identified one by one, as long as it can be inferred from the state that the corresponding segment should not be included in the target scenario measurement, it can also be included in the exclusion criteria.

[0056] Exclusion criteria are not limited to being presented as an independent page; even if it is described as an auxiliary process, subsidiary process, external link process, confirmation process, or other non-target business sub-process, as long as it should not be measured as the main process of the target scenario, it can be included in the exclusion criteria.

[0057] In different embodiments, the exclusion conditions can also be expressed as non-measuring state, exclusion state, auxiliary state, bypass state, non-target service state, or other equivalent names. As long as the corresponding segment should not be included in the target scenario measurement results, it should be regarded as an equivalent expression of the exclusion conditions described in this invention.

[0058] Exclusion criteria can also be distinguished by their contribution to the measurement results: segments identified as exclusion criteria do not contribute positively to the measurable hit segments, and should not be included in the final measurement results even if the segment has a local correlation with the target scene.

[0059] 5.1.6 Correction Processing Correction processing refers to the process of adjusting segment boundaries, cumulative start and end points, or cumulative results during the measurement process in response to transitional conditions, exclusion conditions, abnormal states, or restoration of correlation results.

[0060] The correction process can be performed in real time during the measurement process, or it can be delayed after one or more state changes; it can manifest as boundary relocation after a pause, or as other equivalent processes such as rollback, removal, freezing, supplementation, merging, net adjustment, reversal, or return. As long as its function is to prevent non-hit segments from entering the final measurement result corresponding to the target scenario, it falls under the correction process described in this invention.

[0061] 5.1.7 Hit Fragment A hit segment refers to a logical segment that can be included in resource metering when the target scenario hit conditions are met in the terminal context but the exclusion conditions are not met.

[0062] The hit segment can be either an explicitly stored segment record or a logically measurable time period, and is not limited to being persisted in a fixed object format. The hit segment can be formed directly from consecutive hit states, or it can be formed by merging, concatenating, or aggregating multiple discrete measurable sample windows, activation intervals, and candidate segments.

[0063] In different embodiments, the hit segment can also be described as a valid segment, measurement interval, activation interval, sample aggregation segment, session segment, candidate segment, or other equivalent names. As long as it is used to carry a logical segment that can be included in the measurement of the target scene, it can belong to the hit segment described in this invention.

[0064] The distinction between hit segments and paused segments can be made by whether they contribute to the final measurement result in a measurable cumulative value: the segment corresponding to the hit segment is used to form the segment measurement value and participate in the accumulation, while the segment corresponding to the paused segment is not included in the accumulation as a measurable hit segment, but can be used to connect the hit segments before and after in the restoration association judgment.

[0065] 5.1.8 Structured Measurement Results Objects Structured measurement result objects refer to structured data objects formed around the measurement results of a single or set of target scenarios, used to carry the measurement results and their basis.

[0066] The structured measurement result object can be a complete object, a lightweight object, a summary object, an index object, or a combination thereof. Even if only the necessary fields that can point to the evidence and measurement conclusions are retained, it can still be considered a structured measurement result object according to this invention.

[0067] In different embodiments, the structured measurement result object can also be described as a measurement summary, measurement record, settlement record, measurement voucher, deduction basis record, segment index record, or other equivalent names. As long as it carries the measurement conclusion of the hit scenario and its traceable basis, it can be regarded as an equivalent form of the structured measurement result object of the present invention.

[0068] 5.1.9 The Relationship Between the Form of Business Rules and Their Technical Essence In specific product implementations, the technical logic of measuring only when the scenario is hit and not when the scenario is not hit may manifest as different business rules. For example, deducting the quota only when consumption is allowed, accumulating budget consumption only when the task mode is effective, revoking the quota only when the authorized content mode is enabled, and confirming resource changes or performing reversal or return processing on non-target business segments only when the settlement mode is available.

[0069] These business rules are merely the manifestations of the technical logic of this invention in different products. Their technical essence remains the same: controlling the metering of controlled resources based on whether the target scenario is hit, including entry, suspension, exit, exclusion, or correction.

[0070] 5.2 Overall Process Implementation Example The following combination Figure 1 The overall process of this invention will be described.

[0071] S101 Get runtime status events The terminal device acquires multiple runtime state events. These runtime state events can originate from the terminal operating system, application layer, page layer, and interaction layer, or they can originate from deduced or synthesized events generated after processing, mapping, or combining the original signals.

[0072] The multiple runtime state events can be a sequence of events acquired at different times, and do not need to occur concurrently at the same moment.

[0073] In some embodiments, runtime state events include, but are not limited to: application launch events, page entry events, page progression events, interaction confirmation events, foreground / background switching events, split-screen state events, floating window state events, screen on / off state events, system pop-up events, and excluded page events. Not all of these events are required; the terminal device may select at least one or more in combination based on the actual scenario.

[0074] The runtime state events can be obtained directly from explicit system events, or derived from window sampling results, state machine output results, model output results, mapping table conversion results, or other local monitoring layer derivations.

[0075] S102 Identify whether the target scene has been hit. The terminal device forms the current terminal context locally based on multiple runtime state events and determines whether the current terminal context matches the target scenario.

[0076] The hit identification can employ rule-based matching, rule-model fusion, candidate state filtering, confidence thresholding, state stability windows, hysteresis judgment, or multi-source fusion. Regardless of the intermediate algorithm used, the ultimate goal is to determine whether the current terminal context belongs to the target scene.

[0077] In some embodiments, hit identification can be positive hit identification, that is, directly determining whether the target condition is met; it can also be reverse exclusion identification, that is, first excluding obviously non-target states, and then determining whether the remaining states are allowed to enter metering; or it can first output candidate business states, stable business states, metering allowed states, or settlement allowed states, and then the terminal side generates the final hit judgment.

[0078] In some embodiments, the cloud provides the terminal with target application identifiers, scenario configurations, rule parameters, content tags, classification models, threshold parameters, or other auxiliary information, but the hit determination used to decide whether the controlled resource is included in the metering is still completed on the terminal side.

[0079] S103 Activates meter upon hit When the current terminal context is identified as matching the target scenario, and the current terminal context does not meet the exclusion criteria, the terminal device activates metering for the controlled resources.

[0080] The activation can manifest as real-time commencement of accumulation, or as the start of recording measurable samples, enabling candidate measurement records, entering a pending settlement activation state, initiating background account registration, entering a quota occupancy state, or other equivalent methods. The object of activation is the measurement of controlled resources corresponding to the target scenario, rather than ordinary page dwell statistics.

[0081] The activation does not require an immediate output of a final deduction value visible to the user. As long as resource changes are based on this activation state, it can be considered that activation metering has been performed on the controlled resource.

[0082] S104 Handling of missed hits or when transition / exclusion conditions are met. When it is identified that the current terminal context does not match the target scenario, or when the current terminal context meets the transition or exclusion conditions, the terminal device will pause, exit, or correct the metering of the controlled resources.

[0083] in: - For transitional conditions, pause processing can be performed first, and the segments can be associated with the preceding and following hit segments when the resumption association conditions are met; - For exclusion criteria, the corresponding segment will not be included in the final result as a measurable hit segment of the target scenario; - For cases of abnormal interruption, unstable recovery relationship, or deviation of boundary, correction processing can be performed to adjust segment boundaries, cumulative start and end points, or cumulative results.

[0084] The pause, exit, or correction are not required to be completed at the same time. Even if the system first retains the candidate cumulative value and then removes, rolls back, reverses, returns, or nets the non-hit segments in the subsequent settlement stage, as long as the final result is still that the hit scenario is measured and the non-hit scenario is not measured, it is still an optional implementation of the present invention.

[0085] S105 Determining measurement results based on changes in hit status. The terminal device generates multiple active hit segments based on the hit status changes in the current terminal context, and determines the corresponding segment measurement value for each segment.

[0086] Then, the measurement values ​​of multiple segments are accumulated, and the impact of paused segments, excluded segments, and / or corrected segments on the measurement process is combined to determine the measurement result corresponding to the target scenario.

[0087] Among them, paused segments and excluded segments are not included in the cumulative count as measurable hit segments, and correction segments are used to adjust at least one of the following: segment boundaries, cumulative start and end points, or cumulative results.

[0088] The hit status change can be generated in an event-driven manner, or in a sampling window, polling state, model output range, or a hybrid manner. The measurement result can be a real-time value, a stage value, a session value, a periodic value, a delayed settlement value, a net settlement value, or a derived value.

[0089] The measurement result of this invention is not based on the difference between the opening time and closing time of a single page, which is then subtracted from the background dwell time. Instead, it is determined by a combination of multiple measurable hit segments formed by the changes in the hit state of the target scene.

[0090] 5.3 Target Scenario Joint Limitation Implementation Example In some embodiments, the target scenario is defined by at least two of the following: target application identifier, target page level, target page progression stage, target interaction type, target display form, and target retention conditions.

[0091] like Figure 7 As shown, the target scene can be formed by combining multiple limiting conditions, and the simultaneous satisfaction of at least two of these conditions serves as the basis for the hit judgment.

[0092] For example, in short video content consumption scenarios, the current terminal context is considered to have hit the target scenario only if the terminal meets the two conditions of "the target application is identified as a short video application" and "the target page is in the main content consumption stage", or further meets the conditions of "the target display form is full-screen content playback state" and "the target retention condition is to continuously stay in the target consumption state".

[0093] For example, in the main gameplay scenario, the terminal only enters the corresponding metering permission state when it meets the two conditions of "the target application is identified as a game application" and "the target page level is located in the main gameplay interface", and further meets the condition that "the target interaction type is manifested as gameplay interaction".

[0094] The current terminal context is determined to have matched the target scenario only if at least two conditions for defining the target scenario are met simultaneously. This combined limitation method effectively avoids misjudgments caused by relying solely on a single application or a single page tag.

[0095] 5.4 Runtime State Event Examples In some embodiments, the application launch event is used to indicate that an application enters the running process; the page entry event is used to indicate the switching of the current page level; the page advancement event is used to indicate the progress of the business process within the page; the interaction confirmation event is used to indicate whether a certain type of target interaction has occurred; the foreground / background switching event is used to indicate whether the focus of the terminal window or the foreground state of the application has changed; the split-screen state event, the floating window state event, and the screen on / off state event are used to indicate the display mode and device state; the system pop-up event is used to indicate whether the system-level or application-level pop-up layer interrupts the current scene; and the excluded page event is used to indicate whether the current segment has entered a preset non-target process or excluded process.

[0096] The aforementioned events can originate from explicit system events, as well as from deduced events, synthesized events, window sampling results, state machine output results, or combinations thereof.

[0097] In extended embodiments, the runtime state events may further include task instruction events, tool invocation events, external service access events, mode switching events, sensor state events, action triggering events, manual confirmation events, execution result feedback events, security constraint state events, or combinations thereof. Any event that can objectively reflect whether the current terminal context matches the target scenario and drive whether controlled resources enter metering can be considered an optional implementation of the runtime state events described in this invention.

[0098] 5.5 State Machine Example In some embodiments, the present invention implements metering state control through an explicit state machine or implicit state transition logic. The metering state includes an active state, a paused state, an exited state, and a reactivation state.

[0099] like Figure 2 As shown, the measurement state can switch around the target scene hit recognition result.

[0100] - When it is determined that the current terminal context meets the hit condition but does not meet the exclusion condition, switch to the active state; - When the current terminal context is identified as meeting the transition or exclusion conditions, switch to pause state; - When it is determined that the current terminal context no longer meets the hold conditions corresponding to the target scenario, switch to exit state; - When the hit condition is met again after the paused state, switch back to the active state.

[0101] The state machine can be implemented by enumerating states, or by using flag bits, stage labels, candidate measurement interval states, implicit state transition logic, or other equivalent methods.

[0102] 5.6 Segment Accumulation Example In some embodiments, the present invention logically divides the segments in the measurement process, which may include hit segments, pause segments, exclusion segments, and correction segments.

[0103] like Figure 3 As shown, the different segments mentioned above can form relationships of segment association, pause isolation, exclusion, and correction.

[0104] Hit segments generate segment metrics. Multiple segment metrics are accumulated to form the final metric result. Paused and excluded segments are not included in the metric accumulation. Correction segments are used to adjust segment boundaries, accumulation start and end points, or the accumulated result.

[0105] For example, during a complete usage process, the user first enters the target scene to form the first hit segment, then briefly switches to the system pop-up to form a pause segment, and then returns to the target scene to form the second hit segment. If the interrupted segment meets the recovery threshold condition, the first hit segment and the second hit segment can be associated as the same measurement continuum, and the interrupted interval is marked as a pause segment and not included in the accumulation.

[0106] For example, when a user switches from the target scenario to a non-target active state, an intermediate transition state, or other business states that should not be included in the target consumption, even if the state is still related to the target application, the corresponding segment can be marked as an excluded segment or a paused segment and not included in the accumulation as a measurable hit segment. In some embodiments, this type of state can be further refined into login page, advertising page, payment page, or customer service page.

[0107] In another embodiment, the system does not need to generate explicit fragment objects, but rather forms logically measurable segments based on the combination of multiple sampling windows, activation intervals, or state sequences. As long as the final step is still to accumulate the hit segments and pause, exclude, or correct the non-hit segments, it falls under the fragment accumulation implementation method described in this invention.

[0108] 5.7 Examples of Transition Conditions, Exclusion Conditions, and Recovery Thresholds In some embodiments, transition conditions include: short-term foreground / background switching, system-level pop-up interruption, dwelling on a non-target intermediate page, abnormal page bounce, split-screen display switching, and floating window obstruction.

[0109] like Figure 8 As shown, when the retention conditions corresponding to the target scene are met again within the recovery threshold after an interruption, the hit segments before and after the interruption can be correlated.

[0110] The non-target intermediate page may correspond to an intermediate receiving state, an auxiliary process state, an external confirmation state, or other non-target active state. In some embodiments, the non-target intermediate page may include at least one of a login page, an advertising page, a payment page, or a customer service page; in other embodiments, instead of identifying specific page names one by one, the corresponding segment may be identified as a non-target active state, an intermediate receiving state, or an external confirmation state before pausing, excluding, or correcting the process.

[0111] For the application of recovery threshold, the following rules can be followed: When a short-term foreground / background switch and / or system-level pop-up interruption is detected, and the retention conditions corresponding to the target scene are met again within the preset recovery threshold, the hit segments before and after the interruption are correlated, and the interruption interval is marked as a pause segment or a correction segment.

[0112] The recovery threshold can be a fixed time threshold or a dynamic threshold related to interaction frequency, page completion rate, state stability, device status, or target scene type. Its function is to determine whether the period before and after the interruption belongs to the same measurement continuum, without limiting the specific numerical form.

[0113] Even if an intermediate segment occurs within the recovery threshold, it will not be considered a recoverable associated hit segment as long as the segment belongs to a clearly non-target intermediate page, a clearly excluded process, or a business segment that should not be included in the measurement.

[0114] In some business implementations, the recovery threshold can also be expressed as a session persistence rule, task continuity rule, authorization continuity rule, consumption continuity rule, or other equivalent business rule; as long as its function is to determine whether it should still be included in the same resource metering continuum before and after the interruption, it belongs to the equivalent implementation of this invention.

[0115] 5.8 Example of Structured Measurement Results In some embodiments, the terminal device may also generate a structured measurement result object based on the measurement results.

[0116] like Figure 4 As shown, the structured measurement result object can be used to carry measurement results and their corresponding basis.

[0117] The structured measurement result object may include at least two of the following layers, preferably including the following four layers: 1. A fragment layer for recording at least one of the following: measured fragments, paused fragments, or excluded fragments; 2. Summary layer, used to record at least one of the following: total measurement amount, validity period, exclusion period, or correction result; 3. Basis layer, used to record at least one of the following: reason for state switching, basis for segment boundary, or basis for correction; 4. Index or validation field layer, used to identify the correspondence between structured measurement result objects and original fragment records.

[0118] The structured measurement result object can be used for local logging, review, authorization control, dispute resolution or platform collaboration, but this invention is not limited to specific data formats, fixed field names, fixed hierarchical order or fixed server-side collaboration interfaces.

[0119] If only lightweight summaries, index records, segment mapping information, deduction basis records, or other structured content sufficient to reflect the hit measurement conclusions and their traceability relationships are output, it can still belong to the implementation form of the structured measurement result object described in this invention.

[0120] In some extended embodiments, the structured measurement result object may further include task identifiers, tool call identifiers, action identifiers, takeover session identifiers, authorization confirmation identifiers, risk level identifiers, source node identifiers, or other fields used to support task settlement, responsibility auditing, takeover review, and authorization tracking. Any such fields used to enhance the traceability between measurement conclusions and corresponding evidence can be included in the scope of the structured measurement result object of this invention.

[0121] For example, in one example, the fragment layer can record "fragment 1 is a hit fragment, with start and end times from t1 to t2", "fragment 2 is a paused fragment, with start and end times from t2 to t3", and "fragment 3 is a hit fragment, with start and end times from t3 to t4"; the summary layer can record "the total effective measurement amount is X, and the exclusion duration is Y"; the basis layer can record "the system pop-up window corresponding to fragment 2 interrupted and returned within the recovery threshold"; and the index or verification field layer can record "object ID, fragment association identifier, verification summary, or the identifier corresponding to the original fragment record". Through this type of structured correspondence with at least two layers, the measurement results and their basis can be made traceable and verifiable.

[0122] 5.9 Example of Local and Cloud-Assisted Collaboration on the Terminal Side In some embodiments, the cloud distributes target application identifiers, scene configurations, rule parameters, content tags, classification models, threshold parameters, or auxiliary mapping relationships, and the terminal performs recognition reasoning, state combination judgment, and hit decision locally based on the above auxiliary information.

[0123] In this invention, "execution on the terminal device" means that the terminal side can autonomously complete the decision-making process from obtaining the runtime state, forming the terminal context, to determining the target scenario hit, without relying on the server to return a clear metering entry instruction, a clear deduction instruction, or a clear metering conclusion.

[0124] Even if the terminal receives configuration rules, candidate tags, classification models, or auxiliary parameters from the cloud, as long as the core decision-making logic for ultimately generating the judgment of "whether the target scene is hit" is completed on the terminal side, it still belongs to the local implementation method on the terminal side described in this invention.

[0125] In some embodiments, cloud-based auxiliary information does not replace the core processing flow of the terminal side in completing target scene hit judgment, metering status control, and metering result generation.

[0126] In a preferred embodiment, the cloud provides only rules or models, and the terminal performs inference locally; or the cloud provides candidate tags, and the terminal combines the local state to complete the final judgment; or the cloud provides updated scene configurations, and the terminal does not upload the original events, but only completes the hit judgment and measurement generation locally.

[0127] 5.10 Typical Application Examples Example 1: Short Video Content Consumption Scenarios like Figure 5 As shown, in short video content consumption scenarios, terminal devices can execute corresponding processes around target scene hits, segment formation, and measurement result output.

[0128] In a short video application, the terminal device defines the target scenario based on the target application identifier, the target page level corresponding to the main content stream, the target page progression stage corresponding to the main content consumption, the target display form corresponding to full-screen playback, and the target interaction type corresponding to swiping browsing. This can be further supplemented by the target retention condition of continuously remaining in the target consumption state. When the user is in the target consumption state, the measurement of available time is activated; when the user switches to a non-target active state, the controlled resources corresponding to the target scenario are no longer measured; when the user is in an intermediate transition state related to the target application but whether to continue measuring is yet to be determined, the corresponding segment can be marked as an excluded segment, a paused segment, or a subsequent correction segment. In some embodiments, the intermediate transition state can be further refined into an advertising page, a payment page, a customer service page, or other non-target intermediate pages; in other embodiments, the terminal device may also only identify that the segment has left the target consumption state and entered a non-target active state or an intermediate transition state, and accordingly stop measuring the target scenario. When a user experiences a brief interruption due to a system pop-up and returns to the target consumption state within the recovery threshold, the hit segments before and after the interruption are associated as the same metering continuum, and the interruption interval is not included in the target scenario metering results.

[0129] Example 2: Main Gameplay Scene In a game application, the terminal device defines the target scenario based on the target application identifier, the main gameplay page level, the gameplay progression stage, and the interaction type. When the user is in the target consumption state corresponding to the main gameplay, metering is applied to the corresponding controlled resources; when the user switches to a non-target active state or an intermediate transition state, main gameplay resource metering is not applied to the corresponding segment. In some embodiments, the intermediate transition state can be further refined into an update page, announcement page, login page, payment page, or customer service page; in other embodiments, as long as it can be identified that the current segment is no longer in the target scenario corresponding to the main gameplay, the corresponding metering can be paused, excluded, or corrected. When the user briefly switches to the background and then returns to the main gameplay interface, if the recovery threshold is met, the preceding and following segments are still processed as the same metering session.

[0130] Example 3: Live Streaming Content Consumption Scenarios In live streaming applications, terminal devices define the target scenario based on the target page level corresponding to the main live stream interface, the target display format corresponding to the main content display, the target page progression stage corresponding to the live stream viewing progress, and the target interaction type. This can be further supplemented by the target retention condition of continuously remaining in the target consumption state. Intermediate transition states related to the live streaming application but not suitable for direct measurement as the target consumption state can be treated as exclusion states or transition states. In some embodiments, the intermediate transition states can be further refined into product pages, customer service pages, payment confirmation pages, or other non-target intermediate pages; in other embodiments, as long as it can be identified that the corresponding segment has deviated from the target scenario corresponding to the live stream viewing, that segment can be excluded from the target scenario measurement. If a user briefly switches out of the main live stream interface and then returns, the system can determine whether to associate the preceding and following segments based on a recovery threshold, and thereby form an effective risk exposure duration or authorized quota consumption value.

[0131] Example 4: General Controlled Resource Scenario The controlled resources in this invention are not limited to usage duration. In some embodiments, the controlled resources may also be scene access quotas, temporary authorization quotas, usage license quotas, budget quotas, or other resource forms. As long as the change of the resource is driven by whether the target scene is hit or not, and the result is formed through hit fragment accumulation, transition / exclusion processing, and correction mechanisms, it falls within the technical scope of this invention.

[0132] Example 5: Delayed Settlement or Post-Settlement Correction Scenario In some embodiments, the system can first record candidate metering segments and then generate metering results uniformly after the state stabilizes or the session ends. For non-hit segments, they can be excluded from the final metering results through rollback, removal, cancellation, return, or boundary correction. Therefore, the present invention is not limited to real-time deduction per second, but is also applicable to near real-time, periodic, session-based, netting, or post-processing settlement paths.

[0133] Example 6: Sampling Window or Implicit Segment Scenario In some embodiments, the system may not explicitly generate objects named fragments, but rather form logically hit fragments by merging sampling windows, activation intervals, state sequences, or candidate session segments. As long as these logical segments meet the target scene hit conditions and participate in resource accumulation, and non-hit segments are suspended, excluded, or corrected, they still fall within the scope of the technical solution of this invention.

[0134] Example 7: Metering Permitted State Naming Replacement Scenario In some embodiments, the system does not use the term "target scenario hit," but instead uses "metering permission state," "settlementable state," "effective consumption state," or other business names. Controlled resources are only accumulated when entering the permission state; upon leaving the permission state, the accumulation is frozen, revoked, canceled, or corrected. This type of naming substitution does not change the technical essence of the present invention, which controls whether resources enter metering based on target scenario hit.

[0135] Example 8: Back-end accounting or license transaction scenario In some embodiments, the system does not directly display the second-by-second time deductions externally, but instead maintains accounting records, license records, credit limit records, or other internal business records in the background. Resource consumption is only confirmed when the corresponding transaction originates from a target scenario; for candidate transactions that do not correspond to the target segment, they may not be subsequently recorded, reversed, returned, or netted. This type of background accounting appearance does not change the technical essence of the present invention.

[0136] Example 9: AI Agent Task Execution Scenario In some embodiments, the target scenario may be that the intelligent agent is in a target task execution state, an authorization invocation state, an external action submission state, or other business states that require conditional measurement of resource consumption. The terminal device, agent runtime container, or local control node may identify whether the current terminal context matches the target scenario based on at least one of the following: task instruction events, tool invocation events, external service access events, user confirmation events, agent output status events, execution result feedback events, and security policy status events.

[0137] In one optional implementation, the hit determination of the target scenario can be defined by at least the following two factors: target task identifier, target tool call type, target external service access type, target authorization confirmation status, target output submission stage, and target hold conditions. The intelligent agent is considered to have entered the target task execution state only when at least two of these conditions are simultaneously met, and the current segment is not identified as a risk confirmation state, a cancellation waiting state, a manual review state, or another exclusion state.

[0138] Metering is applied to inference call budget, tool usage quota, task execution duration, external service call quota, or other controlled resources only when the intelligent agent is identified as having entered the target task execution state and meets the corresponding hold conditions. When the agent is only in an idle waiting state, chatter response state, prefetch preparation state, risk confirmation state, or other non-target business state, the corresponding segment is not included in the target scenario metering. In some embodiments, if the agent re-enters the same target task execution state within the recovery threshold after a short interruption, the hit segments before and after the interruption can be associated as the same task metering continuum.

[0139] Furthermore, the terminal device, agent runtime container, or local control node can generate a structured measurement result object based on the aforementioned measurement results. This object may include at least one of the following: task identifier, hit segment summary, tool call basis, authorization confirmation basis, calibration record, index field, or verification field. This is used to support intelligent agent task settlement, responsibility review, authorization audit, or dispute resolution. Even if the system only outputs a lightweight summary object or index object, as long as it points to the measurement conclusions and their basis during the task execution process, it still falls under the technical solution described in this invention.

[0140] Example 10: Embodied Intelligence Tasks and Takeover Responsibilities Scenarios In some embodiments, the target scenario may be a business state in which an embodied intelligent device, service robot, companion terminal, remote collaboration terminal, or other embodied system is in a target task state, remote takeover state, autonomous execution state, manual collaboration state, or other business state that requires conditional measurement or responsibility attribution. The terminal device, local controller, or edge control node may identify whether the current terminal context matches the target scenario based on at least one of action trigger events, sensor status events, mode switching events, remote access events, manual confirmation events, task completion events, and security constraint status events.

[0141] In one optional implementation, the hit determination of the target scenario can be defined by at least two of the following: target task identifier, target mode state, target action type, target remote takeover state, target security constraint state, and target holding conditions. The system is considered to have entered the target task execution state, remote takeover state, or other metering-allowed state only when at least two of these conditions are simultaneously met, and the current segment is not identified as being in standby, self-test, recharge, environmental observation, obstacle avoidance buffer, or other exclusion states.

[0142] Metering is applied to task execution duration, remote assistance quota, action execution quota, risk exposure duration, or other controlled resources only when the system is identified as having entered the target task execution state, remote takeover state, or other metering-permitted state. When the system is only in standby state, self-test state, recharge state, environmental observation state, obstacle avoidance buffer state, or other non-target business state, the corresponding segment is not included in the target scenario metering. In some embodiments, when the embodied system switches between autonomous execution state, manual takeover state, and restored autonomous state, intermediate segments can be paused, excluded, rolled back, reversed, or boundary corrected through transition conditions, exclusion conditions, and correction conditions.

[0143] Furthermore, the terminal device, local controller, or edge control node can generate a structured measurement result object based on the above measurement results. The object may include at least one of the following: task identifier, action sequence summary, takeover session identifier, mode switching basis, manual confirmation basis, correction record, index field, or verification field, thereby forming a traceable record that is more consistent with the actual task execution process and supporting the embodied system's task settlement, responsibility division, takeover audit, service settlement, or post-event dispute resolution.

[0144] Example 11: Spatial Interaction Task Scenario In some embodiments, the target scene can be a target spatial task state, target spatial interaction state, target object operation state, or other business state requiring conditional measurement in a 3D spatial application, spatial memory application, digital twin application, mixed reality application, spatial collaboration application, or other spatialized interaction system. The terminal device, local spatial engine, edge node, or spatial control node can identify whether the current terminal context matches the target scene based on at least one of the following: spatial anchor point events, object location state events, object association state events, viewpoint switching events, spatial path events, interaction confirmation events, dwell state events, task switching events, and display mode state events.

[0145] In one optional implementation, the hit determination of the target scene can be defined by at least the following two factors: target space object identifier, target space region, target interaction type, target viewpoint state, target task progression stage, and target holding conditions. The system is considered to have entered the target space task state, target space interaction state, or other metering-allowed state only when at least two of these conditions are simultaneously met, and the current segment is not identified as a browsing preparation state, free roaming state, non-target object dwell state, display switching buffer state, or other excluded state.

[0146] Metering is applied to task execution duration, space interaction quota, object operation quota, prompt resource call volume, collaborative resource consumption, or other controlled resources only when the system is identified as having entered the target space task state, target space interaction state, or other metering-permitted state. When the system is only in the browsing preparation state, free roaming state, non-target object dwell state, display switching buffer state, or other non-target business state, the corresponding segment is not included in the target scenario metering. In some embodiments, when a user or system switches between the target space task state, intermediate acceptance state, and target space task recovery state, intermediate segments can be paused, excluded, rolled back, reversed, or boundary corrected through transition conditions, exclusion conditions, and correction conditions.

[0147] Furthermore, terminal devices, local space engines, edge nodes, or space control nodes can generate structured measurement result objects based on the aforementioned measurement results. These objects may include at least one of the following: space task identifier, object association summary, space path summary, perspective switching basis, interaction confirmation basis, correction record, index field, or verification field. This supports space task settlement, object operation review, digital twin process auditing, mixed reality collaborative recording, or post-event dispute resolution. Even if the system only outputs lightweight summary objects, object index objects, or path mapping objects, as long as they point to the measurement conclusions and their basis in the space task process, they still fall under the technical solution described in this invention.

[0148] 5.11 Boundary Description To further illustrate the technical boundaries of the present invention, the following description is provided: The following boundary examples are all for solutions that only have the corresponding partial appearance or partial processing method and do not combine the target scene hit judgment, transition / exclusion processing, hit fragment formation or measurement result determination logic described in this invention; if a solution has the following partial appearance features, but at the same time still judges whether the target scene is hit based on the terminal context, and controls whether the controlled resource enters the measurement, whether it is paused, whether it is excluded or corrected accordingly, then it should not be excluded from the technical solution of this invention just because it has the following partial appearance.

[0149] 1. If a scheme uses only foreground entry and background switching as the sole basis for metering triggering, and directly equates the entire foreground running segment with the target scenario, without further distinguishing between the target scenario, non-target active state, intermediate transition state, transition conditions, exclusion conditions, or correction conditions based on the terminal context, then the scheme does not belong to the conditional resource metering scheme based on target scenario hits described in this invention.

[0150] 2. If a solution can identify scene tags, but the tags are only used to output warning signals, addiction scores, intervention levels, or recommendation strategies, and are not used to generate measurement results for the corresponding controlled resources, then the solution does not belong to the technical solution described in this invention.

[0151] 3. If a solution only calculates the difference between page opening time, closing time, and background dwell time, and does not handle the joint constraints, transition conditions, exclusion conditions, or correction processing of the target scenario, then the solution does not belong to the technical solution described in this invention.

[0152] 4. If a solution has resource change records, but these records do not correspond to the target scene hits, and it is impossible to distinguish which segments should be measured and which segments should not be measured based on these records, then the solution does not belong to the technical solution described in this invention.

[0153] 5. If a certain solution has scene recognition or model output, but only uses it as the basis for generating scoring, grading, early warning or control strategies, and does not use it to control whether the controlled resource enters the metering, whether it is suspended, whether it is excluded or whether it is corrected, then the solution does not belong to the technical solution described in this invention.

[0154] The above boundary examples are intended to help understand the technical differences between this invention and ordinary application timing, ordinary page dwell statistics, and ordinary rating and warning schemes. In different implementation interpretations, as long as a scheme still satisfies the core processing logic of controlling whether the controlled resource enters the metering based on the target scene hit and forming the corresponding metering result through the hit state change, it can still be judged whether it belongs to the technical scope of this invention based on its specific technical features, and is not limited by whether it completely adopts the naming or appearance of the above examples.

[0155] 5.12 Equipment Implementation Examples Corresponding to the above methods, the present invention also provides a terminal device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method steps of any of the above embodiments.

[0156] like Figure 6 As shown, the terminal device may include a processor for performing the above method steps and a memory for storing programs.

[0157] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the method steps of any of the above embodiments. illustrate

[0158] Terms such as “activation,” “pause,” “exit,” “correction,” “hit segment,” and “structured measurement result object” can be named as shown in this article or other equivalent names in the field. As long as their technical essence falls within the processing logic of “the controlled resource is measured when the target scene is hit, the non-hit segment is not measured according to the target scene, and the measurement result is formed through the change of the hit state,” they can be regarded as equivalent implementations of the present invention.

[0159] Similarly, concepts such as "target scenario," "controlled resource," "transitional condition," and "exclusion condition" are not limited to a single fixed business term. Even if they are described as target task state, settlement state, consumption permitted state, authorization state, budget state, accounting state, or other business names in different product implementations, as long as their essence is used to control whether resources enter the metering process corresponding to the target scenario, they should all be included in the protection scope of this invention.

[0160] This invention does not require that the hit identification must rely on a fixed identification source, nor does it require that the measurement results adopt a fixed output format. Regardless of whether the identification basis comes from application status, page status, interaction status, traffic characteristics, content characteristics, model output or a combination thereof, and regardless of whether the measurement results are ultimately expressed as real-time deduction values, session settlement values, net amount change values, accounting transaction values ​​or structured records, as long as they essentially reflect the resource measurement results caused by the hit in the target scenario, they can all be regarded as optional implementation forms of this invention.

[0161] Without conflict, the technical features in the above embodiments can be combined with each other. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A terminal-side conditional resource metering method for a target scenario, characterized by, include: Retrieve multiple runtime state events from the terminal device; On the local terminal device, the current terminal context is identified as matching the target scenario based on the multiple runtime state events. When the current terminal context is identified as matching the target scenario, metering of the controlled resources is activated; When it is identified that the current terminal context does not match the target scenario, or when the current terminal context meets the transition condition or exclusion condition, the metering of the controlled resource is paused, exited, or corrected. Based on the hit state changes of the current terminal context, multiple hit segments in an active state are generated, and the measurement results corresponding to the target scene are determined based on the multiple hit segments, and the measurement results are output.

2. The method of claim 1, wherein, The target scenario is defined by at least two of the following: Target application identifier; Target page level; Target page development phase; Target interaction type; Target display form; Conditions for maintaining the objective; The target scene hit identification is premised on the simultaneous satisfaction of at least two conditions used to define the target scene.

3. The method according to claim 1, characterized in that, The runtime status events include at least one of the following: Application launch event; Page entry event; Page advance events; Interactive confirmation event; Foreground / background switching event; Split-screen status events; Floating window state events; Screen on / off state events; System pop-up event; Exclude page events.

4. The method according to claim 1, characterized in that: When it is identified that the current terminal context meets the hit condition but does not meet the exclusion condition, the metering state is switched to the active state; When the current terminal context is identified as meeting the transition or exclusion conditions, the metering state is switched to the pause state. When it is identified that the current terminal context no longer meets the hold conditions corresponding to the target scenario, the metering state is switched to the exit state; When the hit condition is met again after the paused state, the metering state will be switched back to the active state.

5. The method according to claim 1, characterized in that, The measurement results were obtained in the following ways: The corresponding segment metric value is determined based on multiple active hit segments; The measurement results are determined by accumulating the measurement values ​​of multiple segments and taking into account the effects of paused segments, excluded segments, and / or corrected segments on the measurement process. Wherein, the paused segment and the excluded segment are not included in the accumulation as measurable hit segments, and the correction segment is used to adjust at least one of the following: segment boundary, accumulation start and end, or accumulation result; When performing correction processing on the measurement, the correction processing includes at least one of the following operations: relocating the boundary of the measurement segment caused by transition conditions or exclusion conditions, rolling back, removing, canceling or returning the accumulated measurement value, and merging or netting the hit segments before and after the interruption.

6. The method according to claim 1, characterized in that, The transition conditions include at least one of the following: Brief foreground / background switching; System-level pop-up interruption; Staying on a non-target intermediate page; Error page redirection; Split-screen display switching; Floating window obstruction; The non-target intermediate pages include at least one of the following: login page, advertising page, payment page, or customer service page.

7. The method according to claim 6, characterized in that: When a short-term foreground / background switch and / or system-level pop-up interruption is detected, and the retention condition corresponding to the target scenario is met again within the preset recovery threshold, the hit segments before and after the interruption are correlated. The interrupted intervals are then marked as pause segments or correction segments.

8. The method according to claim 1, characterized in that, The method further includes: A structured measurement result object is generated based on the measurement results; The structured measurement result object includes at least two layers: Fragment layer, used to record at least one of the measured fragments, paused fragments, or excluded fragments; The summary layer is used to record at least one of the following: total measurement amount, valid duration, exclusion duration, or correction result; The basis layer is used to record at least one of the following: the reason for state switching, the basis for segment boundary, or the basis for correction. An index or validation field layer is used to identify the correspondence between the structured measurement result object and the original fragment record.

9. A terminal device, characterized in that, include: Memory; processor; The memory stores a computer program, and when the processor executes the computer program, it implements the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 8.