Weak network data synchronization method and system for scenic spot retail scene

By monitoring the network connection between scenic area shops and cloud nodes, and formulating an online voucher distribution management strategy, the problem of uneven verification pressure caused by network anomalies in scenic area retail scenarios was solved, and the verification permissions of shops were optimized and the system's fault tolerance was improved.

CN121771201APending Publication Date: 2026-03-31SHUYAO (HANGZHOU) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In the retail setting of scenic areas, network anomalies increase the risk of duplicate verification of online vouchers, causing excessive verification pressure on some shops, while waste of resources for shops with normal network access. Existing technologies cannot effectively solve the problem of uneven distribution of voucher management strategies.

Method used

By monitoring the network connection between shops within the scenic area and cloud nodes, analyzing abnormal network periods and shop data, we can formulate online voucher distribution management strategies, restrict the verification of shops with abnormal networks, utilize the downtime for data storage and transaction processing, optimize the distribution strategy for shops, and use the time priority principle and amount threshold circuit breaker mechanism to handle data conflicts.

Benefits of technology

This system delegates store verification permissions during periods of network anomalies, preventing excessive load on the verification system, reducing resource waste, ensuring the recovery of core accounts, optimizing store verification processing, and improving the system's fault tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121771201A_ABST
    Figure CN121771201A_ABST
Patent Text Reader

Abstract

The invention provides a weak network data synchronization method and system for a scenic spot retail scene, and belongs to the technical field of data management, and the method specifically comprises the steps: carrying out the determination of a putting processing target of an online voucher of a shop based on a putting management strategy and the association condition of a commodity corresponding to the online voucher in different shops, and when the shop with the abnormal network exists, carrying out limit verification processing on the online voucher according to a target strategy, carrying out data storage and transaction processing strategy determination by using the network disconnection duration, and according to the limit processing data of the online voucher and verification processing permissions of different shops, carrying out verification processing on the online voucher according to the verification processing permissions of the different shops. According to the method, when it is determined that optimization processing of the putting-down processing target of the shop needs to be carried out, the putting-down optimization strategy of the shop is determined according to the network abnormal time periods of different shops and the coincidence condition between the network abnormal time periods and the different shops, and the reliability degree of verification processing of the online voucher is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data management technology, and in particular relates to a method and system for synchronizing data in weak network conditions for retail scenarios in scenic areas. Background Technology

[0002] In existing technologies, SaaS POS systems and membership marketing systems for retail stores have certain cloud-based centralized management and local offline fault tolerance capabilities, but they still have significant shortcomings in scenarios such as weak network conditions in scenic areas, multi-store collaboration, and online voucher verification.

[0003] If a store frequently experiences network anomalies, there is an inevitable risk of duplicate verification of online credentials. Therefore, it is necessary to restrict the verification authority of online credentials to institutions with normal network access, limiting verification to stores with network anomalies. This inevitably increases the processing pressure of online credentials verification for some stores, while wasting the verification processing resources of institutions with normal network access. Therefore, determining a strategy for delegating online credentials based on network anomaly situations to avoid uneven distribution of verification resources has become an urgent technical problem to be solved.

[0004] Therefore, there is an urgent need for a method and system for synchronizing data in weak network conditions for retail scenarios in scenic areas. Summary of the Invention

[0005] To achieve the objectives of this invention, the following technical solution is adopted: Specifically, this application provides a method for weak network data synchronization in scenic retail scenarios, which includes: S1 uses monitoring data on the network connection between shops within the scenic area and cloud nodes to identify shops with network anomalies at different times. Based on the shop data with network anomalies at different times, an online voucher distribution management strategy is formulated. Based on the distribution management strategy and the association of the goods corresponding to the online vouchers in different shops, the online voucher distribution processing target for the shops is determined. S2 When a store has a network anomaly, online credentials are restricted and verified according to the target strategy. Data storage and transaction processing strategies are determined by utilizing the network outage duration. Based on the restricted online credentials data and the verification processing permissions of different stores, when it is determined that the store needs to be decentralized for optimization, the decentralization optimization strategy is formulated according to the network anomaly time of different stores and the overlap between the network anomaly time and different stores.

[0006] The beneficial effects of this invention are as follows: Based on data of shops experiencing network anomalies at different times, a strategy for delegating online credentials was determined. This strategy allows for the delegation of online credential verification authority to different shops with varying numbers of shops experiencing network anomalies at different times, thus avoiding the problem of excessive system load caused by concurrently verifying multiple online credentials when a single shop experiences network anomalies.

[0007] By leveraging network outage duration to determine data storage and transaction processing strategies, and by binding outage duration with log granularity, synchronization strategies, and function switches, this invention implements an adjustable fault tolerance mechanism in resource-constrained edge environments: it retains complete and replayable logs during short-term network outages when network conditions are still acceptable, and proactively reduces business complexity during long-term outages and resource-scarce situations to ensure the recovery of core accounts. Based on the different network outage periods of different shops and the overlap between network outage periods and different shops, the decentralization optimization strategy for the shops is determined. This avoids the technical problem of wasting verification resources for some normal shops due to a large number of network outage periods for a particular shop or a high degree of overlap with other shops. By adjusting the verification permissions of online vouchers based on the shop data corresponding to the goods with online vouchers, the impact on the verification permissions of normal shops during network outage periods is reduced.

[0008] Specifically, online credentials will be subject to restricted verification according to the target strategy, including: If the online credentials are used by multiple stores for verification, verification will be restricted to stores with network issues to avoid duplicate verification.

[0009] Specifically, the duration of network outages is used to determine data storage and transaction processing strategies, including: During the first-level network outage period: all functions are retained, and all data of the store is stored in the local high-availability queue; During the second-level network outage period: activate local disk protection, compress non-critical logs, prioritize the storage of transaction data, and restrict some high-risk operations; When the network is in a Level 3 outage period: a mandatory alarm will be triggered, allowing only basic cash / offline payment transactions, stopping the strong inventory verification service, and suspending the online voucher reconciliation function.

[0010] Furthermore, once the store network, which was in a network anomaly state, is restored, the specific process includes: Time priority principle: When there is a conflict between the cloud platform and the edge data uploaded by the store, the last write timestamp of the store's edge server shall prevail in principle; Amount threshold circuit breaker mechanism: The system presets an "automatic merging threshold". If the difference in amount caused by data conflict is within the threshold, the cloud automatically adopts the edge data, overwrites the old data in the cloud, and records an "automatic reversal log". If the difference exceeds the threshold, the system triggers the "circuit breaker mechanism," instead of automatically overwriting the error, it generates an "abnormal pending order" and pushes it to the manual review interface for intervention by finance personnel.

[0011] Furthermore, the optimization process for determining the target of decentralizing shops needs to be optimized, specifically including: Based on the restricted processing data of online vouchers, identify the shops whose online vouchers require restricted verification and designate them as restricted shops; Based on the different verification and processing permissions of restricted shops, identify restricted shops that do not have the verification and processing permissions for online credentials and classify them as fully restricted shops. Based on the data of restricted shops and fully restricted shops in different time periods using online vouchers, determine whether the optimization of the shop decentralization process is necessary.

[0012] Secondly, the present invention provides a computer system comprising: a memory and a processor connected in communication, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the aforementioned method for weak network data synchronization for scenic retail scenarios when running the computer program.

[0013] Other features and advantages will be set forth in the following description, and the objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.

[0014] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0015] The above and other features and advantages of the present invention will become more apparent from a detailed description of exemplary embodiments thereof with reference to the accompanying drawings.

[0016] Figure 1 This is a flowchart of a weak network data synchronization method for scenic retail scenarios; Figure 2 This is a flowchart illustrating the method for determining the online voucher distribution management strategy; Figure 3 This is a flowchart illustrating the method for determining the target of online voucher distribution and processing for shops; Figure 4 This is a flowchart for optimizing the process of identifying the shops that need to be transferred to lower levels. Detailed Implementation

[0017] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0018] Example 1 like Figure 1 As shown, this application provides a method for weak network data synchronization in scenic retail scenarios, specifically including: S1 uses monitoring data on the network connection between shops within the scenic area and cloud nodes to identify shops with network anomalies at different times. Based on the shop data with network anomalies at different times, an online voucher distribution management strategy is formulated. Based on the distribution management strategy and the association of the goods corresponding to the online vouchers in different shops, the online voucher distribution processing target for the shops is determined. Furthermore, the cloud node is a server for acquiring and synchronizing the transaction data of the shops.

[0019] Furthermore, the monitoring data for the network connection is determined based on the period of network anomalies between the store and the cloud node.

[0020] It should be noted that the network anomaly period between the store and the cloud node is determined based on the period when the network connection between the store and the cloud node is not in a smooth state.

[0021] Furthermore, the data on shops with network anomalies during the specified time period are determined based on the shops that belong to the period of network anomalies.

[0022] Specifically, such as Figure 2 As shown, the method for determining the online voucher decentralization management strategy is as follows: Scenario: A large tourist attraction plans to launch a joint marketing campaign, distributing online vouchers (certificates) to tourists covering dozens of sub-categories of goods across five major categories: catering, retail, entertainment, transportation, and accommodation. Hundreds of participating shops within the attraction are involved in the campaign.

[0023] Core objective: Before the event begins, establish a unified, preventative online voucher distribution management strategy. This strategy will set an "upper limit on the number of redeemable product types" for all participating merchants to prevent the risk of widespread redemption chaos due to network instability in the scenic area.

[0024] Preset Strategy (Strategy 1): Full Category Authorization. Each store can authorize all relevant product types within its business scope. (Suitable for ideal situations where the network is extremely reliable).

[0025] Second preset strategy (Strategy 2): Global low category limit. Set a uniform and low limit of L1 = 2 categories for all stores that can be redeemed. (Applicable to strictly controlled scenarios with high network risks).

[0026] Third preset strategy (Strategy 3): Higher global category limit. Set a uniform and higher limit of redeemable categories (L2 = 4) for all stores. (Applicable to balancing scenarios where there is a certain degree of network risk).

[0027] S21 Based on the data of shops with network anomalies in different time periods, identify the shops that belong to the time period with network anomalies and designate them as shops with network anomalies. Identifying "network-abnormal shops" involves filtering through historical data to find all shops that have experienced network connectivity failures. This is the foundational data for assessing the impact of network issues on business operations.

[0028] Definition of terms: Network anomaly period: refers to the period during which the network connection between a specific shop in the scenic area and the central server is consistently substandard (e.g., latency > 1 second, packet loss rate > 20%).

[0029] Shops with abnormal network conditions: Shops that have experienced at least one "abnormal network period" within the statistical period of analysis.

[0030] Specific implementation: The system iterates through the logs of the past 30 days, removes duplicates, and finds that a total of 55 shops have experienced at least one network anomaly (5+50+10, no duplicates assumed). Output: Set of shops with network anomalies, number 55.

[0031] S22 determines the number of abnormal merchants in different periods of network anomaly based on the data of abnormal merchants in different periods of network anomaly. By statistically analyzing the number of "malicious online merchants" at different times, and quantifying the severity (breadth of impact) of each period of network anomaly, we can determine whether a strict control strategy is necessary.

[0032] Definitions: Number of abnormal shops during a network outage period: The total number of shops in an abnormal state within a specific, continuous "network outage period".

[0033] Specific implementation: According to the logs, the number of abnormal shops corresponding to the three abnormal time periods are 5, 50, and 10 respectively. The output is a list containing three elements [5, 50, 10], which represent the severity of the three events respectively.

[0034] S23 uses the network anomaly time period data and the number of network anomaly shops in different network anomaly time periods to determine the online voucher distribution management strategy.

[0035] It is understood that, based on the data of the network abnormal period, the dates of the network abnormal period are determined. When the proportion of the number of dates of the network abnormal period is less than the preset proportion threshold, the online voucher distribution management strategy is determined to be the preset strategy.

[0036] Based on the initial assessment of the frequency of network anomalies, the significance of this step is to evaluate whether the network anomalies are isolated events. If the percentage of days with anomalies is extremely low, the network can be considered generally reliable, and there is no need to initiate restrictive policies.

[0037] Percentage of dates with network anomalies = (Number of days with network anomalies) / (Total number of days analyzed).

[0038] Specific Implementation and Judgment: Calculation: In the past 30 days, anomalies occurred on days 5, 15, and 22, totaling 3 days. Percentage = 3 / 30 = 0.1 (10%). Judgment: The percentage of 0.1 is not less than the preset threshold of 0.1, indicating that network anomalies are not extremely rare events (occurring at a frequency of 10%). Therefore, the unrestricted "preset strategy (strategy one)" cannot be used. We must proceed to the next step and consider initiating a restrictive strategy.

[0039] Additionally, it is understood that if the proportion of dates with network abnormality periods is not less than a preset proportion threshold, the number of network abnormal shops in different network abnormality periods is determined, and it is determined whether there are network abnormality periods with a number of network abnormal shops greater than a preset abnormal shop number threshold. If so, the online voucher distribution management strategy is determined to be the second preset strategy; otherwise, proceed to the next step. Determine if a "large-scale regional anomaly" event exists, and identify if a severe network failure with widespread impact has occurred. These events represent the greatest risk source; if they occur, they could lead to widespread write-off paralysis, therefore the most stringent prevention strategies must be employed.

[0040] Definition: Network abnormal period: The number of abnormal shops exceeds the preset threshold for the number of abnormal shops: refers to abnormal events where the number of affected shops exceeds N_shop (30 shops in this example).

[0041] Specific implementation and judgment: Checklist [5, 50, 10]. Where 50>30, judgment: Is there an abnormal period affecting more than 30 shops? Result: Yes (Event 2 affected 50 shops). Historically, there have been major network failures affecting more than a quarter of the shops (50 / 200). This indicates that there is a structural risk point in the scenic area's network. The strictest preventive measures must be taken to limit the scope of damage that a single failure may cause.

[0042] Final strategy determined: adopt the second preset strategy (strategy two).

[0043] Policy implications: In the upcoming event, each of the 200 shops within the scenic area can only be authorized to redeem online vouchers for a maximum of two product types. Shops offering more than two product categories must negotiate with the operator to determine their two most core product categories for participation.

[0044] Based on the number of abnormal merchants in different network abnormal periods, determine the network abnormal periods with multiple abnormal merchants, and determine whether the proportion of network abnormal periods with multiple abnormal merchants in the network abnormal periods is greater than the preset abnormal period proportion threshold. If so, determine that the online voucher distribution management strategy is the second preset strategy; otherwise, proceed to the next step. If the second step determines "no" (i.e., there is no major event affecting more than 60 shops), the process continues.

[0045] Step 3: Assess whether "anomalies affecting multiple shops" occur frequently. Significance of this step: Even without major failures, frequent anomalies affecting multiple shops in a small area indicate that the network environment is not stable enough and requires regular, moderate-intensity control.

[0046] Definition of terms: Network abnormal period with multiple abnormal stores: This usually refers to an abnormal event where the number of affected stores is greater than 1. The proportion of such periods in the total number of network abnormal periods = (number of such periods) / (total number of network abnormal periods).

[0047] Specific implementation and judgment (assuming the data is changed to [5, 8, 12]): All three events affect more than one shop, so the number of "multiple shop abnormal periods" is 3, the total number of abnormal periods is also 3, and the percentage = 3 / 3 = 1.0 (100%).

[0048] Judgment: The percentage of 1.0 is greater than the preset threshold of 0.5. Yes, although the impact of a single incident is small, small-scale network disturbances occur frequently and always affect multiple stores. This indicates insufficient network stability, and the second preset strategy (Strategy 2) needs to be activated for routine management. Strategy 2 means: all stores, each authorized to redeem a maximum of 2 types of goods.

[0049] Determine whether the average number of abnormal merchants during different network anomaly periods is greater than a preset threshold for the number of abnormal merchants. If so, determine that the online voucher distribution management strategy is the second preset strategy; otherwise, determine that the online voucher distribution management strategy is the third preset strategy.

[0050] Furthermore, the preset strategy is that all shops with products corresponding to online vouchers are considered as targets for decentralization, meaning that online voucher verification is performed on all of them.

[0051] Furthermore, the second preset strategy is to determine the number of online vouchers issued by the store by multiplying the first ratio by the number of goods corresponding to the online vouchers in the store.

[0052] Furthermore, the third preset strategy is to determine the number of online vouchers issued by the store by multiplying the second ratio by the number of goods corresponding to the online vouchers in the store.

[0053] This approach is a data-driven, preventative risk management process. It assesses the overall risk level of the scenic area's digital infrastructure by analyzing three key dimensions of historical network anomaly data—frequency of occurrence, severity of each incident, and event distribution pattern—and automatically selects appropriate global control strategies accordingly.

[0054] Strategy 1 (All Categories): Represents the highest level of trust in network reliability. Strategy 3 (Maximum 4 types): Represents an adaptive balance to frequent small-scale disturbances. Strategy 2 (Maximum 2 types): Represents mandatory risk control for networks with a history of significant failures.

[0055] This approach ensures that potential redemption chaos is kept within acceptable limits before the event begins, thus guaranteeing the smooth and orderly conduct of the entire scenic area's marketing activities and maintaining basic operational order even in the face of online challenges.

[0056] Specifically, the first ratio is smaller than the second ratio.

[0057] Specifically, such as Figure 3 As shown, the method for determining the target of the online voucher distribution for the aforementioned store is as follows: S21 takes the product corresponding to the online voucher as the matching product, determines the store with the matching product of the online voucher based on the matching products of different online vouchers of the store, and takes it as the matching store; S22 determines the target for the distribution of online vouchers to the store based on the decentralization management strategy and the matching store data of different online vouchers.

[0058] Specifically, based on the decentralization management strategy and the matching store data for different online vouchers, the target for decentralizing the online vouchers of the store is determined, including: Based on the aforementioned decentralization management strategy, determine the target number of online vouchers to be decentralized for different stores; Based on the number of the target number of the decentralization processing, the target number of online vouchers for the store is determined with the goal of maximizing the number of online vouchers that can be fully decentralized in the matching store.

[0059] Specifically, the constraints include the following: a. Single shop capacity: Each shop (or each shop type) can handle a maximum of k=2 types of online voucher verifications.

[0060] b. Coverage of a single voucher: For each type of online voucher, the number of stores covered by its processing targets cannot exceed M=5.

[0061] Optimization objective: Under the premise of satisfying the above two constraints, determine the "decentralization processing target" (one store type) for each type of voucher, so as to maximize the number of vouchers that can be "fully decentralized" in their target type.

[0062] "Full Decentralization": All shops under the target type of the voucher obtain the right to redeem the voucher, and these shops are themselves the matching shops of the voucher.

[0063] S2 When a store has a network anomaly, online credentials are restricted and verified according to the target strategy. Data storage and transaction processing strategies are determined by utilizing the network outage duration. Based on the restricted online credentials data and the verification processing permissions of different stores, when it is determined that the store needs to be decentralized for optimization, the decentralization optimization strategy is formulated according to the network anomaly time of different stores and the overlap between the network anomaly time and different stores.

[0064] Specifically, online credentials will be subject to restricted verification according to the target strategy, including: If the online credentials are used by multiple stores for verification, verification will be restricted to stores with network issues to avoid duplicate verification.

[0065] Edge server-driven write access control: The system comprises cloud servers and edge servers deployed in stores. * Write access locking: To prevent data conflicts, the cloud server maintains a "write access lease." When an edge server is online or in offline mode, the cloud locks write access to the store's inventory, allowing only edge servers with a specific sequence ID to submit inventory changes, and rejecting non-read operations from other channels (such as the web management interface).

[0066] Lease management mechanism: To ensure that the same inventory record has only one valid write source at any given time in scenarios with multiple stores and multiple edge nodes, a separate "lease management module" is set up in the cloud to maintain lease records with the following structure for each store dimension: - `lease_id`: A unique identifier for the lease; - `shop_id`: Store identifier, associated with inventory records; - `edge_id`: The identifier of the edge server holding the lease; - `start_ts / expire_ts`: timestamps for lease start and expiration; - `lease_status`: Lease status, values ​​include ACTIVE / EXPIRED / SUSPENDED.

[0067] The lease state machine operates as follows: - Once a store's edge server establishes a connection with the cloud and completes identity authentication, the cloud issues the corresponding lease record and sets the status to ACTIVE; - During normal online periods, the edge server sends a renewal request to the cloud at a fixed heartbeat interval, which includes the current `lease_id` and the local timestamp, and the cloud updates `expire_ts` accordingly; - If the cloud does not receive a renewal heartbeat from the edge server within the preset time window, the lease status will be set to SUSPENDED first, and then set to EXPIRED after a further timeout. - When the lease is in the ACTIVE state, the cloud only accepts synchronous or asynchronous logs from the corresponding `edge_id` for write requests to the store's inventory. Other sources (such as price changes in the operations backend or direct transfers across stores) are only allowed to be read or enter the pending queue. When the lease is in the EXPIRED state, the cloud can receive backend writes when necessary, so as to allow for manual intervention when the edge is offline for a long time or fails.

[0068] For scenarios such as cross-store transfers and cross-store returns, this invention treats them as "cross-store transactions" and coordinates them through a dedicated cross-store transaction channel in the cloud: the cloud adds a short-term SUSPENDED flag to the lease records corresponding to the two stores, suspends local direct writing, and restores the original lease status after the cross-store transaction is completed and the completion log is recorded, thereby avoiding multiple edge nodes from making uncoordinated writes to the same inventory at the same time.

[0069] Offline processing mechanism for special business scenarios (new): Online voucher (QR code / barcode) verification: Voucher data structure: Online vouchers are issued by the cloud and contain the following key fields: voucher_id (unique voucher identifier), user_id (member identifier), pickup_point_id (specifies pickup point or store), issue_ts (issuance time), expire_ts (expiration time), max_redeem_times (number of redemptions allowed, usually 1), and an asymmetric encrypted signature that covers the above fields.

[0070] Encrypted verification: After receiving the voucher to be revoked, the edge server first uses the public key to verify the signature and checks whether issue_ts and expire_ts are within the allowed range, so that the authenticity and timeliness can still be verified even when the network is disconnected.

[0071] A precise pre-issuance mechanism based on pickup points: The cloud, based on the `pickup_point_id` attribute of the voucher, pre-issues only unredeemed voucher identifiers (which can be `voucher_id` or its hash digest) related to that pickup point to the corresponding edge servers in the form of a "whitelist," forming a local whitelist. This whitelist includes stores in a network abnormal state, with fields including: `voucher_id / hash`, `pickup_point_id`, `valid_flag`, `local_status`, and `last_update_ts`. This mechanism avoids the network and storage overhead of synchronizing all vouchers across all edge nodes, and allows edge nodes to perform positive authentication based on the local whitelist when the network is down, enabling redemption operations only for vouchers within the whitelist.

[0072] Anti-replay strategy and redeemed list: Edge servers maintain a local "redeemed list," with record fields including: voucher_id, edge_id, redeem_ts, txn_id (local redemption serial number), local_seq (local sequence number), etc. The redemption process is as follows: First, verify the signature and timestamp; then, check if the voucher exists and is in an unused whitelist record; then, generate a unique txn_id and write it to the redeemed list, while updating the valid_flag / local_status of the corresponding record in the whitelist table (e.g., marking it as "used" or removing it directly). If "double-spending" occurs (i.e., the same voucher_id is recorded as redeemed by two edge servers with different edge_ids during a network outage), when the cloud subsequently synchronizes and aggregates redemption records by voucher_id, it will find that the number of records exceeds max_redeem_times. Based on this, the excess part will be marked as "suspected double-spending" and enter the risk control process.

[0073] Complex reverse transactions (returns / exchanges): Local closed loop: For the scenario of "local offline purchase -> local offline return", the system adds a log entry in the local log queue in the form of "reversal record" that is linked into the same transaction chain as the original purchase record. The field contains the txn_id or chain_id of the original transaction. After the network is restored, the cloud will automatically offset the amount and inventory during replay.

[0074] Transaction Chain ID and Abnormal Chain Handling: For complex transaction chains such as "purchase -> verification -> return -> repurchase", the system assigns a unified Transaction Chain ID (chain_id) to each series of related operations. Each log record, in addition to basic business fields, also includes: chain_id, step_type (e.g., CREATE_ORDER, REDEEM, REFUND, REORDER), step_seq (intra-chain step number), local_ts (local timestamp), edge_id, payload_hash, etc. After network recovery, the cloud groupes logs by chain_id and sorts them by step_seq to determine if any steps are missing. If the step sequence number corresponding to a certain chain_id is complete and the order conforms to the predefined transaction model, then the inventory and fund changes of the entire chain will be replayed in sequence. If a missing intermediate step is detected (e.g., a refund step exists but the corresponding reconciliation step is missing), the entire transaction chain is marked as suspended, automatic replay is stopped, and the transaction is pushed to the manual review queue to prevent automatic modification of inventory or accounts due to incomplete information, which could lead to discrepancies between the accounts and the actual situation.

[0075] Data synchronization and merging: After the network is restored, the edge servers upload logs in order of "transaction serial number". The cloud server, after verifying the validity of the sequence number, further merges and replays the logs according to the chain_id and step_seq.

[0076] Specifically, the duration of network outages is used to determine data storage and transaction processing strategies, including: During the first-level network outage period: all functions are retained, and all data of the store is stored in the local high-availability queue; During the second-level network outage period: activate local disk protection, compress non-critical logs, prioritize the storage of transaction data, and restrict some high-risk operations; When the network is in a Level 3 outage period: a mandatory alarm will be triggered, allowing only basic cash / offline payment transactions, stopping the strong inventory verification service, and suspending the online voucher reconciliation function.

[0077] Tiered processing strategy based on network outage duration: The edge server has a built-in timer and policy configuration engine that triggers different levels of business rules based on the duration of network outages. Level 1 (short-term network outage, such as <1 hour): Full functionality is retained, and data is stored in a local high-availability queue.

[0078] Level 2 (intermittent network outage, such as 1-24 hours): Activate local disk protection, compress non-critical logs (such as surveillance videos), prioritize the storage of transaction data, and restrict some high-risk operations (such as large-value prepaid card transactions and cross-store returns).

[0079] Level 3 (Prolonged network outage, such as >24 hours): Triggers a mandatory alarm, allows only basic cash / offline payment transactions, stops the strong inventory verification business, and suspends the online voucher reconciliation function.

[0080] From a technical implementation perspective, different network outage levels not only correspond to different service on / off states, but also to different log recording and synchronization strategies: Under the primary strategy, the system records each transaction in the form of a "detailed log", which includes complete product details, payment method, customer identifier and other fields, so that the transactions can be replayed one by one after the network is restored; Under the secondary strategy, for high-frequency, low-value transactions, the system can first perform batch aggregation locally (e.g., by hour or by product dimension) to reduce the number of log entries and disk writes while ensuring that it will not affect the accuracy of subsequent inventory and accounting. Under the three-tier strategy, the system retains only critical "count" and "balance" data, and ensures that even if some fine-grained logs are lost, overall consistency can be restored through manual inventory and reconciliation by restricting business types (cash / offline payment only, online voucher verification suspended).

[0081] By binding the duration of network outages with log granularity, synchronization strategies, and function switches, this invention implements an adjustable fault tolerance mechanism in resource-constrained edge environments: retaining complete and replayable logs in short-term network outage scenarios where network conditions are still acceptable, and proactively reducing business complexity to ensure the recovery of core accounts during long-term network outages and resource shortages.

[0082] Furthermore, once the store network, which was in a network anomaly state, is restored, the specific process includes: Time priority principle: When there is a conflict between the cloud platform and the edge data uploaded by the store, the last write timestamp of the store's edge server shall prevail in principle; Amount threshold circuit breaker mechanism: The system presets an "automatic merging threshold". If the difference in amount caused by data conflict is within the threshold, the cloud automatically adopts the edge data, overwrites the old data in the cloud, and records an "automatic reversal log". If the difference exceeds the threshold, the system triggers the "circuit breaker mechanism," instead of automatically overwriting the error, it generates an "abnormal pending order" and pushes it to the manual review interface for intervention by finance personnel.

[0083] Automatic conflict resolution algorithm based on time sequence and threshold: Time priority principle: When there is a conflict between cloud data and uploaded edge data, the last write timestamp of the edge server shall prevail, because the edge is closer to the real physical transaction site.

[0084] Amount threshold circuit breaker mechanism: The system presets an "automatic merging threshold" (e.g., single transaction difference amount < 500 yuan).

[0085] If the difference in amount caused by data conflict is within the threshold, the cloud will automatically adopt the data from the edge, overwrite the old data in the cloud, and record an "automatic reversal log".

[0086] If the difference exceeds the threshold, the system triggers the "circuit breaker mechanism," instead of automatically overwriting the error, it generates an "abnormal pending order" and pushes it to the manual review interface for intervention by finance personnel.

[0087] For online voucher reconciliation logs, double-spending conflict detection and arbitration strategies are implemented at the voucher_id level (e.g., retaining the earliest reconciliation record and marking the rest as abnormal), thereby achieving eventual consistency while ensuring security.

[0088] Specifically, such as Figure 4 As shown, the optimization process for determining the target shops that need to be decentralized includes: I. Top-level scenarios and rules: Scenic Area Scale: 200 shops. Online Vouchers: 10 types, P1 to P10. Core Rule: Each shop is authorized to redeem exactly 2 types of online vouchers. Voucher combinations vary and cover all shops.

[0089] Core security rule: When a certain credential is used by an authorized merchant with a network error, the system will activate a security mode for that credential: only merchants with network errors are allowed to verify the credential offline, while all merchants with normal network access are prohibited from verifying the credential.

[0090] Monitoring objective: Analyze system operation data to determine whether the current credential-store authorization scheme is reasonable and whether it needs to be optimized.

[0091] II. Definitions of core terms: Stores experiencing network issues: Stores that have actually experienced network failures for a given credential.

[0092] Restricted shops: For a certain credential, the network is normal, but the system policy prohibits the verification of the credential, that is, the credential has a network failure.

[0093] Completely Restricted Shops: This refers to a situation where, within a certain timeframe, all online credentials authorized for verification by a specific shop are listed as "network abnormal shops." Therefore, according to the rule of "only abnormal shops can be verified," although the shop itself has a normal network connection, it is prohibited from verifying all its authorized credentials, thus being in a state of "complete restriction."

[0094] Validation constraint factor (for a specific time period): Number of "completely restricted shops" during that time period / Total number of shops in the scenic area. Used to measure the breadth of the global and devastating impact of a single network anomaly on normal shop operations.

[0095] Preset time period: The historical time window used for backtracking analysis; in this example, it is the most recent 7 days.

[0096] Table 1 Restricted Data

[0097] S31 uses the restricted processing data of online credentials to identify the merchants whose online credentials are subject to restricted verification processing, and identifies them as restricted merchants. S32 determines the restricted shops that do not have the verification processing authority for online credentials based on the different verification processing authority of the restricted shops, and treats them as fully restricted shops. Based on the data of restricted shops and fully restricted shops in different time periods using online vouchers, S33 determines whether it is necessary to optimize the target of delegating shops.

[0098] Understandably, if different online vouchers all have restricted stores within the most recent preset time period, then it is determined that the store decentralization processing target needs to be optimized.

[0099] To determine whether optimization is needed, the first level of judgment is to check whether all vouchers have triggered the security rule. This involves checking the following vouchers: P1 (time period 1, 5), P2 (time period 2), P3 (time period 3, 5), P4 (time period 1), P5 (time period 2), P6 (time period 4), P7 (time period 1), P8 (time period 4), P9 (time period 2), and P10 (time period 4). All 10 vouchers have been found to have triggered the rule.

[0100] Result: Yes. Decision: Trigger optimization, process ends.

[0101] Additionally, it should be noted that if different online vouchers have varying restrictions on shops within the recent preset time period, the data on fully restricted shops in different time periods is obtained to determine whether fully restricted shops exist in all time periods. If so, it is determined that the optimization of the shop decentralization process needs to be carried out; otherwise, proceed to the next step. If P8 never triggers the rule, the first layer will judge "no" and proceed to the second layer.

[0102] Second-level judgment: Does "completely restricted shops" exist in every time period? Check: No in time period 3 (0 shops). Result: No. Proceed to the third level.

[0103] Based on the proportion of the number of fully restricted shops in a given time period to the total number of shops, the verification restriction factor for that time period is determined. It is then determined whether there is a time period in which the verification restriction factor is greater than the preset restriction factor threshold. If so, it is determined that the optimization processing of the shop decentralization target needs to be carried out. If not, proceed to the next step. The third level of judgment: whether there is a period of "complete restriction on the proliferation of shops", and calculate and verify the restriction factor: period 1: 8 / 200 = 0.04, period 2: 12 / 200 = 0.06, period 3: 0 / 200 = 0, period 4: 15 / 200 = 0.075, period 5: 5 / 200 = 0.025; Judgment: Does a factor > 0.05 (F1) exist? Yes (0.075 > 0.05 in time period 4). Decision: Trigger optimization.

[0104] Based on the average value of the verification constraint factor in different time periods, determine whether the average value of the verification constraint factor in different time periods is greater than the preset factor threshold. If so, proceed to the next step; otherwise, determine that no optimization processing of the store decentralization target is required. Is the average severity too high? Average factor = (0.04+0.06+0+0.075+0.025) / 5 = 0.2 / 5 = 0.04. Judgment: 0.04>0.025 (F2). Decision: Proceed to the fifth level.

[0105] Based on the restricted store data of different online vouchers, determine the number of time periods during which different online vouchers have restricted stores, and based on the number of time periods during which different online vouchers have restricted stores, determine whether it is necessary to optimize the store decentralization processing target.

[0106] Analysis: It is necessary to identify which type of voucher anomaly frequently causes its combination with other vouchers to become a "fully restricted merchant". This requires complex correlation analysis. For example, if P1 is anomaly in both periods 1 and 5, and the vouchers paired with it (such as P4, P3, P7) are also frequently anomaly, then the merchant holding both P1 and these vouchers will frequently become a fully restricted merchant.

[0107] Simulation conclusion: Analysis revealed that the combination of P1 and P4 resulted in 6 shops being completely restricted in time period 1; the combination of P1 and P3 resulted in 5 shops being completely restricted in time period 5. Therefore, for shops that possess both P1 and P4, the following determination is made: Does a certain combination of credentials result in the shop becoming a completely restricted shop no more than 3 times? Final decision: Do not trigger optimization.

[0108] Furthermore, based on the different online vouchers that limit the number of shops available during specific time periods, it is determined whether the optimization of the shop allocation target is necessary, specifically including: Based on the different online vouchers that restrict the number of time slots for different shops, determine the online vouchers whose number of time slots exceeds the preset threshold. Based on online voucher data where the number of time periods exceeds a preset threshold, determine whether optimization processing of the store decentralization target is needed.

[0109] It should be noted that if there are online vouchers in a time period that exceed the preset time period threshold, then it is determined that the store's decentralization processing target needs to be optimized.

[0110] Specifically, the method for determining the optimization strategy for the distribution of shops is as follows: Preliminary status: The system has determined that optimization is needed. The current task is to determine which shops to optimize and how to optimize them.

[0111] Input data: Based on historical monitoring data (such as the last 30 days), we know: Each store has its own network anomaly period record. During each anomaly period, a list of stores experiencing anomalies simultaneously (i.e., overlapping stores) is also included. The core task is to identify "problem stores" based on their own anomaly frequency and anomaly overlap, and to develop targeted optimization strategies (such as reducing the number of authorization certificates or revoking the right to redeem certain certificates).

[0112] Shops with network anomalies: Shops that have experienced at least one period of network anomalies within the most recent preset period.

[0113] The period during which the store experienced network outages: The specific time during which the store itself experienced network failures.

[0114] Overlapping stores: Other stores that also experienced network anomalies during a specific period of time as a particular store. This reflects the scope of impact or common fault range when a particular store experienced an anomaly.

[0115] Shops subject to optimization: Shops that are determined by this process to require adjustments to their online credential authorization scheme.

[0116] Decentralized management strategy: This refers to global constraints, such as "each store can authorize a maximum of k types of vouchers" or "a single voucher can be decentralized to a maximum of M stores." Its strictness (whether it's a default / second / third strategy) will affect the local optimization threshold.

[0117] Number of shops with the aforementioned online voucher: This refers to the number of shops within the entire scenic area that are authorized to redeem this type of online voucher.

[0118] Based on the network anomaly data of different shops, identify the shops that have network anomaly periods in the most recent preset time period and designate them as network anomaly shops; Step 1: Determine the set of "Network Abnormal Shops". Significance of this step: Filter out all shops with "bad records" from historical data. This is the target screening pool for the entire optimization process.

[0119] Glossary: ​​Network anomaly period data: Logs that record the start and end times of each network failure for each store. Network anomaly store: A store that has experienced at least one network anomaly period within the most recent preset time period (30 days).

[0120] Specific Implementation: The system scans all logs from the past 30 days. Statistics show that 48 shops, including shops A, B, and C, experienced at least one network anomaly. Output: A list containing the IDs of these 48 shops, called the "set of shops with network anomalies".

[0121] Based on the overlap between the abnormal network periods of the shops and different shops, the shops that belong to the abnormal network periods of the shops are identified and regarded as overlapping shops. Based on the network anomaly data of the shops, the network anomaly time period data of the shops, and the overlapping shops in different network anomaly time periods, the decentralization optimization strategy of the shops is determined.

[0122] Furthermore, the number of abnormal online stores is obtained. If the number of abnormal online stores is greater than a preset threshold for the number of abnormal online stores, then all abnormal online stores are treated as stores for optimization. The number of online vouchers for the optimized online stores is determined by multiplying the third ratio by the number of goods corresponding to online vouchers in the store.

[0123] Determining whether to trigger "global large-scale optimization" is the first level of decision-making. If the proportion of shops with unstable networks is too high, it indicates that the problem is widespread, and a simplified "one-size-fits-all" strategy should be adopted to uniformly reduce the quota for all problematic shops.

[0124] Glossary: ​​Number of abnormal network shops: The total number of shops in the "set of abnormal network shops". Preset threshold for the number of abnormal shops (N_total): The critical number that triggers global optimization.

[0125] Specific implementation and judgment: Quantity obtained: Number of abnormal network stores = 48; Judgment: 48 is not greater than 50 (N_total), so a large-scale global optimization is not triggered. Proceed to an individualized, fine-grained judgment process for each abnormal network store.

[0126] Additionally, it can be understood that if the number of network-abnormal shops is not greater than a preset threshold for the number of abnormal shops, the number of network-abnormal time periods of the shops is obtained, and it is determined whether the average daily number of network-abnormal time periods of the shops is less than a preset threshold. If yes, proceed to the next step; otherwise, the shops are designated as shops for optimization. For online vouchers in the shops, if the number of shops with online vouchers is greater than a preset threshold, the shops are not designated as targets for the online voucher decentralization.

[0127] Determining if a business experiences "frequent anomalies" is significant because it identifies businesses with extremely poor network quality that are themselves sources of instability. These businesses are the primary targets for optimization.

[0128] Glossary: ​​Number of Network Abnormal Periods for a Shop: The total number of network abnormalities that occurred in the shop within 30 days. Average number of network abnormal periods per day = (Number of abnormal periods) / 30 days. Preset threshold (N_daily): The daily average frequency threshold for being judged as "frequent abnormalities".

[0129] Specific implementation methods and judgments: Data obtained: Shop A had 8 anomalies, with a daily average of 8 / 30 ≈ 0.267 anomalies / day. Judgment: 0.267 is not less than 0.1 (N_daily). Result: No (0.267>0.1). Shop A is considered to have frequent anomalies.

[0130] Decision: Mark Shop A as a "Shop to be Decentralized for Optimization". Proceed to the fine-tuning sub-process for its authorization certificate.

[0131] (Voucher Adjustment): Regarding the voucher deprivation logic for shops with frequent abnormalities, instead of unilaterally canceling all permissions, the logic selectively revokes the right to redeem vouchers on those with "sufficient market supply." This reduces the impact on other shops.

[0132] Definitions: Number of shops with the aforementioned online voucher: The total number of shops authorized to redeem this type of voucher within the entire area. Preset shop quantity threshold (S1): The standard for determining whether a voucher is "excessive". If this value is exceeded, the supply is considered sufficient.

[0133] Specific implementation method and judgment (for Shop A's P3 certificate): Data acquisition: P3 has 12 authorized points in the entire area. Judgment: 12>8 (S1), Shop A will not be used as the target for P3 decentralization. That is, in the new optimization scheme, it is recommended to revoke Shop A's authorization for P3 reimbursement.

[0134] Specific implementation and judgment (for Shop A's P8 certificate): Data acquisition: P8 has 5 authorized points in the entire area. Judgment: 5 is not greater than 8 (S1). Shop A is retained as the target for P8's decentralization. Optimization result of Shop A: P3 authorization is revoked, and P8 authorization is retained.

[0135] Additionally, it is understood that if the number of shops with the online voucher exceeds a preset threshold, and all shops with the online voucher are considered to be network-abnormal shops, then the shop with the largest inventory will be the target for the online voucher to be distributed and processed.

[0136] Based on the overlapping store data of the store during different network anomaly periods, determine whether the average number of overlapping stores during different network anomaly periods is greater than a preset overlapping store number threshold. If so, the store is designated as a store for optimization. For online vouchers in the store, if the number of stores with online vouchers is greater than a preset store number, the store is not designated as a target for the online voucher. Otherwise, proceed to the next step. If the decentralization management strategy is determined to be the third preset strategy or a preset strategy, then shops whose average number of overlapping shops in different network anomaly periods is greater than a preset threshold (less than a preset threshold for the number of overlapping shops) are designated as shops for decentralization optimization. For online vouchers in these shops, if the number of shops with online vouchers is greater than a second preset value for the number of shops, then these shops are not designated as targets for decentralization of the online vouchers. Otherwise, it is determined that these shops do not belong to the shops for decentralization optimization of online vouchers.

[0137] Specifically, the preset threshold for the number of shops is less than the second preset threshold for the number of shops.

[0138] Example 2 Secondly, the present invention provides a computer system comprising: a memory and a processor connected in communication, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the aforementioned method for weak network data synchronization for scenic retail scenarios when running the computer program.

[0139] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and non-volatile computer storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0140] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0141] The above description is merely one or more embodiments of this specification and is not intended to limit this specification. Various modifications and variations can be made to the one or more embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of one or more embodiments of this specification should be included within the scope of the claims of this specification.

Claims

1. A weak network data synchronization method for a scenic spot retail scene, characterized by, Specifically comprising: The network connection monitoring data between the shops inside the scenic spot and the cloud node is used to determine the network abnormal shop data in different time periods, and the online voucher offloading management strategy is formulated based on the network abnormal shop data in different time periods. Based on the offloading management strategy and the association of the online voucher corresponding goods in different shops, the online voucher offloading processing target of the shop is determined; When there is a network abnormal shop, the online voucher restriction verification processing is performed according to the target strategy, and the data storage and transaction processing strategy are determined by using the network interruption duration. According to the online voucher restriction processing data and the verification processing authority of different shops, it is determined that the optimization processing of the offloading processing target of the shop needs to be performed. According to the network abnormal period of different shops and the coincidence between the network abnormal period and different shops, the offloading optimization strategy of the shop is formulated.

2. The weak network data synchronization method for a scenic spot retail scene of claim 1, wherein, The cloud node is a server for acquiring and synchronizing the transaction data of the shop.

3. The weak network data synchronization method for a scenic retail scene according to claim 1, characterized in that, The network connection monitoring data is determined according to the network abnormal period between the shop and the cloud node.

4. The weak network data synchronization method for a scenic spot retail scene of claim 3, wherein, The network abnormal period between the shop and the cloud node is determined according to the period when the network connection state of the shop and the cloud node is not in the unobstructed state.

5. The weak network data synchronization method for a scenic retail scene according to claim 1, wherein, The method for determining the online voucher offloading management strategy is: Based on the network abnormal shop data in different time periods, the shops belonging to the network abnormal period in the time period are determined and are taken as network abnormal shops; According to the network abnormal shop data in different network abnormal periods, the number of network abnormal shops in different network abnormal periods is determined; Based on the network abnormal period data and the number of network abnormal shops in different network abnormal periods, the online voucher offloading management strategy is determined.

6. The weak network data synchronization method for a scenic spot retail scene of claim 1, wherein, The online voucher restriction verification processing according to the target strategy, specifically comprising: If the online voucher has multiple verification processing shops, only the verification processing in the network abnormal shop is limited, so as to avoid the occurrence of repeated verification.

7. The weak network data synchronization method for a scenic retail scene according to claim 1, wherein, Data storage and transaction processing strategy are determined by using the network interruption duration, specifically comprising: When in the first network interruption duration interval: full function reservation, all data of the shop is stored in the local high availability queue; When in the second network interruption duration interval: start local disk protection, compress non-critical logs, and give priority to transaction data storage; limit part of the high-risk operation; When in the third network interruption duration interval: trigger forced alarm, only allow basic cash / offline payment transactions, stop inventory strong verification business, and suspend online voucher cancellation function.

8. The weak network data synchronization method for a scenic retail scene according to claim 1, wherein, When the network of the shop in the network abnormal state is restored, specifically comprising: Time sequence priority principle: when there is a conflict between the cloud platform and the edge data uploaded by the shop, the last write timestamp (Last Write Timestamp) of the edge server of the shop is used as the standard in principle; Amount threshold fuse mechanism: the system presets an "automatic merging threshold", if the difference amount caused by data conflict is within the threshold, the edge data is automatically adopted by the cloud, the old cloud data is overwritten, and an "automatic correction log" is recorded; If the difference amount exceeds the threshold, the system triggers the "fuse mechanism" and does not perform automatic overwrite, but generates an "exception pending single" and pushes it to the manual review interface for intervention by financial personnel.

9. The weak network data synchronization method for a scenic spot retail scene of claim 1, wherein, The method for determining the deployment optimization strategy of the store is: Based on the network anomaly period data of different stores, determine the stores that have network anomaly periods in the latest preset time period and take them as network anomaly stores; According to the coincidence between the network anomaly period of the store and different stores, determine the stores that belong to the network anomaly period in the network anomaly period of the store and take them as coincident stores; Based on the network anomaly store data, the network anomaly period data of the store and the coincident stores in different network anomaly periods, determine the deployment optimization strategy of the store.

10. A computer system comprising: The memory and processor connected by communication, and the computer program stored on the memory and capable of running on the processor, characterized in that the processor executes the computer program to perform the weak network data synchronization method for the scenic retail scene of any one of claims 1-9.