A method for shared acquisition and independent view lifecycle isolation management for multi-window replication on the same device, an electronic device, and a computer-readable storage medium.

By collecting data uniformly through the main session, copying the session's read-only interface to display the view, and performing idempotent cleanup in abnormal situations, the system solves the problems of resource waste and data inconsistency in scenarios with multiple observation windows on the same device, thereby improving the system's stability and anomaly recovery capabilities.

CN123068148APending Publication Date: 2026-11-10SHENZHEN FINI INNOVATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611231794.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

In existing technologies, the session management architecture for scenarios with multiple observation windows on the same device suffers from problems such as duplicate data reception, redundant thread scheduling, data inconsistency, and difficulty in anomaly recovery. In particular, when the observation window is closed, it can easily lead to interruption of the overall data acquisition task and waste of resources.

Method used

The system adopts a unified data collection method with a master session and a replica session that subscribes to data and displays views through a read-only interface. The master session and the replica session establish a subscription relationship and handle abnormal exits through idempotent cleanup operations to ensure data consistency and resource isolation.

Benefits of technology

This approach improves stability and user experience by enabling the parallel use of multiple observation windows, avoids resource waste and data inconsistency, and ensures the stability of anomaly recovery and the reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123068148A_ABST
    Figure CN123068148A_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer processing technology, and more particularly to a method for shared data acquisition and independent view lifecycle isolation management for multi-window replication on the same device, an electronic device, and a computer-readable storage medium. The method includes: creating a main session and a replication session, establishing a subscription relationship between the replication session and the main session, with the replication session subscribing to the main session's data stream through a read-only interface and maintaining only its own view state container; even if closed, it does not affect the normal operation of the main session; when the replication session exits abnormally, it supports the reconstruction of the replication session and the restoration of the view state; when the main session stops data acquisition or closes the session, a global consistency check must be performed before the data acquisition threads are stopped and the connection to the device is disconnected. Therefore, by centralizing data acquisition in the main session, sharing subscription in the replication session, isolating view states, and providing idempotent cleanup of anomalies, the stability and user experience of using multiple observation windows in parallel on the same device are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer processing technology, and in particular to a method for shared acquisition and independent view lifecycle isolation management for multi-window copying on the same device, an electronic device, and a computer-readable storage medium. Background Technology

[0002] In practical applications of logic analyzer host computers, these computers often need to analyze device data from multiple perspectives. Therefore, multiple observation windows are opened for the same device to allow parallel viewing of data from different time periods, protocol layers, and analytical perspectives. To meet the requirement of using multiple interfaces simultaneously on the same device, the industry generally adopts a session management architecture where observation windows correspond one-to-one with acquisition links and observation windows are strongly bound to acquisition functions. While this type of session management architecture can meet the basic requirement of using multiple interfaces in parallel, it also has several drawbacks. These include: multiple observation windows establishing separate acquisition connections can lead to issues such as duplicate data reception and redundant thread scheduling, significantly consuming system resources and increasing the device's workload. Furthermore, the deep coupling of the observation window's lifecycle with the acquisition link means that closing any observation window can interrupt the overall data acquisition task, interfering with other normally functioning observation windows. In addition, each observation window independently maintains its acquisition status and data copy, which can easily cause inconsistencies in interface display content, cursor positioning offsets, and deviations in historical data interpretation, resulting in poor overall data consistency. Furthermore, when one of the observation windows is abnormally destroyed or rebuilt, due to the lack of a unified session management system, issues such as subscription relationship failure, abnormal running status, and duplicate binding are likely to occur, and the abnormal recovery process lacks a stable and feasible execution path.

[0003] It is evident that, in order to address the aforementioned shortcomings, there is an urgent need to optimize the session management architecture for scenarios with multiple observation windows on the same device, so as to ensure the overall stability and reliability of the data acquisition link while each observation window operates independently. Summary of the Invention

[0004] In view of this, the present invention proposes a shared acquisition and independent view lifecycle isolation management method, electronic device and computer-readable storage medium for multi-window replication on the same device, aiming to improve the defects of the existing session management architecture for multi-view window scenarios on the same device.

[0005] To solve the above problems, the present invention adopts the following technical solution: In a first aspect, this invention proposes a method for shared acquisition and independent view lifecycle isolation management for multi-window replication on the same device, including: In response to receiving a request to create a main session, a main session is created; wherein, the main session is used to establish a connection with an external device, continuously collect data through the device, and maintain the collection status during the data collection process; When a request to create a replication session is received, a replication session and a corresponding replication view window are created, and a corresponding replication session identifier is generated; the subscription relationship between the replication session and the main session is registered according to the replication session identifier; wherein, the main session can establish subscription relationships with multiple replication sessions; During the replication session, the replication session reads the data collected by the main session through a read-only interface and displays the data through the replication view window; and if a user interaction command is received, modification of the view state container of the replication session is only allowed. When a close window command is received for the copied view window, the copied view window is closed, the subscription relationship of the copied session is terminated, and the local view resources of the copied view window are released, while the main session and the data acquisition thread continue to run. When the main session receives a command to stop data acquisition or close the session, a global consistency check is performed to confirm that there is no active replication session subscription relationship. Then, the data acquisition thread is stopped and the connection with the device is disconnected in sequence, and the data acquisition thread resources, device connection resources and local view resources are released simultaneously. When it is confirmed that the copy session has exited abnormally, an idempotent cleanup operation is performed to remove residual subscription relationships; the subscription relationship is re-established, and the original display state of the copy view window corresponding to the copy session is restored.

[0006] Further, the step of creating a main session in response to receiving a request to create a main session includes: In response to receiving a request to create a main session, a main session is created, and a connection is established between the main session and an external device to continuously collect data uniformly through the device, and to maintain the collection status during the data collection process; wherein, maintaining the collection status includes the main session negotiating collection parameters, managing the data collection thread, uniformly generating raw data and decoded data, and providing read-only interfaces and subscribed data channels to each replica session.

[0007] Further, when a request to create a replication session is received, a replication session and a corresponding replication view window are created, and a corresponding replication session identifier is generated; registering the subscription relationship between the replication session and the main session based on the replication session identifier includes: When a request to create a replication session is received, it is determined whether a primary session has already been created. If a copy session has already been created, a copy session and a corresponding copy view window are created, and a corresponding copy session identifier is generated synchronously. Based on the copy session identifier, an attribution mapping relationship corresponding to the main session is constructed, and the subscription relationship registration between the copy session and the main session is completed. The constructed attribution mapping relationship is stored in a preset attribution mapping list, and the registered subscription relationship is stored in a preset subscription relationship list. If a reference counting mechanism is used, the number of active replication sessions will be incremented by one, and the read-only interface handle of the master session will be sent to the replication session. If the subscription registration operation fails, the established ownership mapping relationship will be rolled back; if a reference counting mechanism is used, the number of active replication sessions will be decremented by one, and a warning message will be output to avoid abnormal hanging states.

[0008] Furthermore, after the replication session reads the data collected by the main session through a read-only interface and displays it through the replication view window during the replication session's operation, the process further includes: If the replication session initiates a request to adjust globally effective configuration parameters, the parameter change will be processed uniformly through the change entry provided by the main session. The replication session cannot directly perform parameter write operations.

[0009] Furthermore, when a close window command is received for the copied view window, the copied view window is closed, the subscription relationship of the copied session is terminated, and the local view resources of the copied view window are released, while maintaining the continuous operation of the main session and the data acquisition thread, including: When a close window command is received for the copied view window, the copied view window is closed. The subscription relationship of the corresponding copied session is retrieved and released according to the copy session identifier corresponding to the copied view window, and the subscription relationship is removed from the subscription relationship list. The local cache and view state container resources of the copied view window are released, and the entry corresponding to the copied session is deleted from the ownership mapping list. If a reference counting mechanism is used, the number of active replication sessions will be decremented by one; During the execution of the window closing command, the main session and data acquisition thread continue to run, and the other copy sessions also remain operational.

[0010] Furthermore, the execution of a global consistency check to confirm the absence of active replication session subscription relationships includes: Perform a global consistency check; wherein, the global consistency check includes checking whether the number of active replication sessions is zero, whether the subscription relationship list is empty, and whether there are any entries corresponding to replication sessions that have not been deleted remaining in the attribution mapping list; if all the check results are no residual content, then check whether there are any unfinished asynchronous distribution callbacks pointing to the cancelled replication sessions; If the verification result is that it does not exist, then it is confirmed that there is no active replication session subscription relationship; If the verification result is positive, the global consistency check will be re-executed in the next event cycle, and the subscription relationship status of the active replication session will be determined based on the result of the re-executed global consistency check.

[0011] Furthermore, the step of sequentially stopping the data acquisition thread and disconnecting from the device, and simultaneously releasing the data acquisition thread resources, device connection resources, and local view resources, includes: Stop the data acquisition thread and refresh or discard any unfinished cached data; then close the device operation handle and disconnect the communication connection with the device; simultaneously unregister the entries belonging to the main session in the subscription relationship list, clean up the shared distribution object, and release the data acquisition thread resources, device connection resources, and local view resources.

[0012] Furthermore, when it is confirmed that the copy session has abnormally exited, an idempotent cleanup operation is performed to remove residual subscription relationships; the subscription relationship is re-established, and the original display state of the copy view window corresponding to the copy session is restored, including: When it is confirmed that the copy session has exited abnormally, an idempotent cleanup operation is performed; wherein, the abnormal exit includes abnormal program exit caused by the crash of the copy view window, and abnormal offline caused by the forced termination of the child process corresponding to the copy session. Based on the replication session identifier corresponding to the replication session that exited abnormally, the residual subscription relationships and ownership mapping relationships are cleared, and the replication session creation and subscription relationship registration process is completed again. At the same time, real-time data snapshots and buffer generation numbers are pulled from the main session and populated back into the corresponding replication view window so as to restore the current replication view window to the display state before the abnormal exit, and the data interaction link is restored synchronously.

[0013] Secondly, the present invention also provides an electronic device comprising: Memory, used to store program instructions; and A processor is configured to execute the program instructions to implement the steps of the shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device as described above.

[0014] Thirdly, the present invention also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the shared acquisition and independent view lifecycle isolation management method for multi-window copying on the same device as described above.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: A method for shared data acquisition and independent view lifecycle isolation management for multi-window replication on the same device, an electronic device, and a computer-readable storage medium are disclosed. First, a master session is created to establish a connection with the device and collect data uniformly. This avoids the redundant data reception and thread scheduling issues caused by multiple replication sessions establishing separate acquisition connections, fundamentally reducing system resource consumption and device load. Second, replication sessions subscribe to the data stream of the master session through a read-only interface, achieving data sharing rather than duplicate acquisition. Each replication session maintains only its own view state container; user interactions do not affect the acquisition state of the master session, thus effectively isolating the view lifecycle from the acquisition lifecycle. Therefore, even if a replication view window is closed, only the corresponding subscription relationship is terminated and local resources are released, without affecting the continuous operation of the master session and data acquisition threads, avoiding the risk of a replication view window closing accidentally triggering a global acquisition stop. Furthermore, by establishing a subscription relationship between replication sessions and the master session, data consistency among multiple replication sessions is guaranteed, avoiding problems such as inconsistent display, cursor offset, and historical data interpretation conflicts caused by each replication view window independently maintaining its own data copy. For abnormal exits of replication sessions, idempotent cleanup operations are required to promptly remove residual subscription relationships, supporting stable reconstruction of replication sessions and restoration of view states, thus improving the system's anomaly recovery capabilities and operational stability. Finally, when the main session stops data acquisition or closes the session, a global consistency check confirms the absence of active replication session subscription relationships before sequentially stopping data acquisition threads and disconnecting from the device. This avoids premature resource release and system instability caused by accidental operations, achieving layered lifecycle management. It is evident that this shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device, along with the electronic device and computer-readable storage medium, systematically solves the problems of wasteful acquisition resources, lifecycle coupling, data inconsistency, and difficult anomaly recovery in existing session management architectures for multi-view window scenarios on the same device through centralized data acquisition in the main session, shared subscriptions in replication sessions, view state isolation, and anomaly idempotent cleanup. This significantly improves the stability and user experience of parallel use of multiple view windows on the same device. Attached Figure Description

[0016] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a flowchart illustrating an embodiment of the shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device according to the present invention. Figure 2 This is a schematic diagram of the structure of an electronic device in the hardware operating environment involved in the embodiments of the present invention. Detailed Implementation

[0017] The solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] It should be noted that if the embodiments of the present invention involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.

[0019] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.

[0020] It should be noted that the host computer of a logic analyzer is a computer system that runs logic analysis software. It is used to receive, process, and display data collected by external devices (or logic analyzers), while also providing a user interface and data analysis functions. A logic analyzer is an electronic test instrument used for digital signal acquisition and analysis. It has high-speed, multi-channel sampling capabilities and usually exists as a standalone instrument, working in conjunction with the host computer of the logic analyzer through an interface.

[0021] To support users opening multiple observation windows in parallel, the logic analyzer's host computer establishes a complete interconnected link between device connection, acquisition thread, data distribution, and view session, provided that the device is connected to the same device. This link affects: device connection and session handle, acquisition thread and unified data output, the decoding view and timeline interaction status of each observation window, and is responsible for resource release when observation windows are closed and the project exits.

[0022] Please see Figure 1 The diagram shown is a flowchart illustrating an embodiment of the shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device according to the present invention.

[0023] In this embodiment, the shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device includes: Step S100: In response to receiving the request to create a main session, create a main session.

[0024] The main session is used to establish a connection with external devices and continuously collect data through the devices, while maintaining the collection status during the data collection process.

[0025] Specifically, the master session is responsible for establishing device connections, negotiating acquisition parameters, managing data acquisition threads, and uniformly generating raw and decoded data. It also provides read-only interfaces or subscribed data channels to each replica session. The master session is the only session entity with acquisition control permissions (including starting and stopping acquisition, reconnecting, and releasing device handles). This single-instance acquisition mechanism ensures the uniqueness and stability of the data source and avoids resource waste caused by multi-instance acquisition.

[0026] Step S200: When a request to create a replication session is received, a replication session and a corresponding replication view window are created, and a corresponding replication session identifier is generated; the subscription relationship between the replication session and the main session is registered according to the replication session identifier.

[0027] The main session can establish subscription relationships with multiple replica sessions.

[0028] Specifically, the copy session only carries the view and interaction, including window handles, canvas viewports, zoom / cursor / filter / decoding layer display preferences, etc. The copy session obtains the corresponding copy view window (i.e., observation window) by subscribing to the main session's data output to display the required content, without creating a second set of device connections or a second set of acquisition threads.

[0029] A session (including the main session and copy sessions) represents logical ownership and resource subscription relationships. The copy view window is the UI carrier. One copy session typically corresponds to one top-level / embedded copy view window, but multiple copy view controls can also correspond to each other in a multi-screen layout, as long as the subscription relationship is still managed according to the copy session identifier.

[0030] Data acquisition and processing on the main session side can be performed on the worker thread, while drawing and interaction on the copy session side are mostly performed on the UI thread. The two are connected through thread-safe subscription and delivery, avoiding direct blocking of data acquisition on the UI thread.

[0031] To clearly illustrate the overall operational logic of the shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device according to the embodiments of the present invention, the architecture of multi-window replication on the same device is now divided into four links according to function, as follows: 1. Data Acquisition Link: Responsible for establishing communication connections with the device, configuring sampling parameters, starting and stopping acquisition threads, and continuously receiving data blocks, aiming to build a unique and stable data source.

[0032] 2. Data distribution chain: The uniformly collected data stream is distributed to each replication session through subscription or broadcast, which can avoid repeated streaming and data parsing, and also ensure the timing and content consistency of data distribution.

[0033] 3. View Session Link: Each copied view window independently maintains interactive states such as zoom, cursor, filtering, and decoding levels, and generates a unique display interface based on a unified data source, enabling multiple copied view windows to be observed in parallel without interfering with each other's states.

[0034] 4. Lifecycle Management Link: Standardize the execution order of replication session creation and destruction, session exit, device disconnection and resource reclamation, and prevent coupling anomalies caused by the closure of the replication view window accidentally triggering a global stop to data collection.

[0035] In scenarios where multiple view windows are running on a single device, improper binding of the view lifecycle and the acquisition lifecycle can easily lead to problems such as duplicate acquisition, resource waste, and inconsistent data states. Lifecycle management is a core element in ensuring stable system operation. In this embodiment, the main session manages the acquisition lifecycle, while the copy sessions only manage the view lifecycle. The exit of a copy session must not be semantically equivalent to the main session ceasing acquisition.

[0036] Step S300: During the operation of the replication session, the replication session reads the data collected by the main session through a read-only interface and displays the view through the replication view window; and if a user interaction command is received, only the view state container of the replication session is allowed to be modified.

[0037] Specifically, during the replication session, the replication view window is displayed normally, the controller is ready, and user operations are supported. When users perform interactive actions such as zooming, cursor dragging, protocol layer switching, and measurement settings, only the view state container and local cache of the current replication session are modified, and the collected data from the main session is retrieved and displayed through a read-only interface. Through interface layering and permission verification, strict constraints are implemented, preventing the replication session from calling the main session's proprietary interfaces, changing collection parameters, stopping data collection, or re-establishing device connections. The interface display of each replication view window may be asynchronous, but the underlying data source remains consistent. Furthermore, for global configurations such as the sampling rate, parameter changes are uniformly handled through the change entry provided by the main session. The replication session can only submit configuration adjustment requests; direct device operation is strictly prohibited to avoid inconsistencies caused by independent modifications from multiple endpoints.

[0038] Step S400: When a close window instruction is received for the copied view window, the copied view window is closed, the subscription relationship of the copied session is terminated, and the local view resources of the copied view window are released, while the main session and the data acquisition thread continue to run.

[0039] Step S500: When the main session receives a stop data acquisition or close session command, a global consistency check is performed to confirm that there is no active replication session subscription relationship. Then, the data acquisition thread is stopped and the connection with the device is disconnected in sequence, and the data acquisition thread resources, device connection resources and local view resources are released simultaneously.

[0040] Step S600: When it is confirmed that the copy session has exited abnormally, an idempotent cleanup operation is performed to remove residual subscription relationships; the subscription relationship is re-established, and the original display state of the copy view window corresponding to the copy session is restored.

[0041] Specifically, idempotent cleanup operations refer to operations that, regardless of how many times they are repeated, produce the same final result as if they were executed only once, without causing any abnormal issues. This operation is a conventional technique in the field and will not be described in detail here.

[0042] It should be noted that steps S400, S500 and S600 are not in any particular order, and one of them may be implemented.

[0043] Compared with existing technologies, the shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device according to embodiments of the present invention has the following technical advantages: Unified source of facts: Data and collection status are generated and held by the master session only, and the replication session only consumes the data distribution results. This eliminates the data drift problem caused by each replication session independently collecting copies, and ensures that the cursor calculation, data statistics, and protocol parsing of multiple replication sessions can be aligned to the same timeline and cache generation number.

[0044] View parameter isolation: The display differences between different replicated view windows originate solely from the independent view state containers of each replicated session, rather than from multiple sets of acquired data. This achieves the technical effect of a single data source and independent observation from multiple perspectives. The view parameters of each replicated view window are independent of each other and do not overlap, resulting in greater maintainability.

[0045] Permission boundaries are solidified: All data collection control APIs are consolidated into the main session for unified management, so that the replication session cannot trigger control operations such as stopping data collection or reconnecting during the compilation or runtime phases, or the calls will have no effect, effectively preventing the problem of global data collection from stopping due to accidental operation of the replication session.

[0046] Subscription lifecycle management: An explicit subscription mechanism is used between the replication session and data distribution. The subscription relationship is uniformly registered when it is created and forcibly released when it is destroyed, which completely avoids abnormal issues such as dangling pointers and illegal access caused by callbacks after the replication session is destroyed.

[0047] Global final state convergence: A global dependency state verification mechanism that requires global consistency checks is adopted to ensure that resources such as device connections and acquisition threads are only released when there are no replication session dependencies, effectively avoiding the competition conflict issues of resource hanging and repeated release.

[0048] The architecture is scalable: the data distribution layer can flexibly adapt to various implementation methods such as message bus, shared memory ring buffer read-only mapping, etc. As long as the single-write-multiple-read and subscription communication semantics are met, the overall architecture can be adapted and compatible, possessing good versatility and scalability.

[0049] In some embodiments of this application, step S100 includes: Step S101: In response to receiving the request to create a main session, create a main session and establish a connection between the main session and the external device so as to continuously collect data through the device and maintain the collection status during the data collection process.

[0050] The maintenance of the acquisition status includes the main session negotiating acquisition parameters, managing the data acquisition thread, uniformly generating raw and decoded data, and providing read-only interfaces and subscribed data channels to each replication session.

[0051] The shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device in this invention establishes a session management mechanism of single-instance acquisition capability, multiple-instance view capability, and hierarchical lifecycle management, which maintains the global stability of the acquisition link while ensuring independent interaction of multiple replication sessions.

[0052] In some embodiments of this application, step S200 includes: Step S201: When a request to create a replication session is received, determine whether a primary session has already been created.

[0053] Step S202: If a replication session has already been created, a replication session and a corresponding replication view window are created, and a corresponding replication session identifier is generated synchronously. Based on the replication session identifier, an ownership mapping relationship corresponding to the main session is constructed, and the subscription relationship registration between the replication session and the main session is completed. The constructed ownership mapping relationship is stored in a preset ownership mapping list, and the registered subscription relationship is stored in a preset subscription relationship list.

[0054] Step S203: If a reference counting mechanism is used, the number of active replication sessions is incremented by one, and the read-only interface handle of the master session is sent to the replication session.

[0055] Step S204: If the subscription registration operation fails, roll back the established ownership mapping relationship; if the reference counting mechanism is used, the number of active replication sessions will be decremented by one, and a warning message will be output to avoid abnormal hanging state.

[0056] The following details the execution flow of creating and accessing a copy session and its corresponding copy view window, including: Triggering conditions: The user manually creates a copy view window, clones a copy session, or restores a multi-window layout from a layout template.

[0057] Input / Prerequisites: The main session already exists and has been bound to the device (or at least the main session has been created and can be retrieved in the subscription relationship list); if the main session does not exist, the main session creation process must be executed first, and it is forbidden to create a device connection separately by copying the session.

[0058] Processing actions: 1) Generate the current replication session identifier, record the ownership mapping relationship between the replication session and the primary session, and write it into the ownership mapping list; 2) Register subscription relationships at the data distribution layer, add the current replication session to the main session's subscription relationship list, or establish an equivalent callback / signal connection; 3) If a reference counting mechanism is used, the number of active replication sessions will be incremented by one; 4) Inject the main session data exit handle (i.e., read-only interface handle) into the view controller of the currently copied view window, so that it can only pull or receive push data through this read-only interface in the future.

[0059] Output / Postconditions: The new replication session can receive data streams from the same source as the primary session, and only one set of acquisition threads provides services within the process.

[0060] Anomaly and boundary handling: If subscription registration fails, the ownership mapping relationship and reference count (i.e., the number of active replication sessions) should be rolled back synchronously, and an alert message should be output to the user to avoid abnormal hanging states such as replication sessions being created but without data or the number of active replication sessions increasing.

[0061] This invention presents a shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device, constructing a layered session architecture where the main session manages acquisition tasks, replicated sessions handle view display, and global rules control resource release. Its core objective is to ensure that when multiple replicated view windows run concurrently on the same device, the underlying acquisition link is unique, multiple copies of the upper-layer view are displayed, and window exits do not accidentally terminate the acquisition service, and that the system can automatically rebuild and recover after anomalies occur. This architecture follows three parallel constraint rules, including: (1) For the same device and main session combination, only one device connection and data acquisition thread are configured within the process; (2) Data is generated uniformly from a single point and supports multiple copies of view windows for multi-point display; (3) Operations such as stopping data collection and disconnecting device connections can only be executed by the main session after confirming that there are no global dependencies.

[0062] Based on the aforementioned layered session framework, the system needs to maintain multiple state information items during operation to support session management, data distribution, state verification, and resource control, specifically including: Master Session Identifier: Used to uniquely identify the master session that undertakes the managed data collection task, and to bind the master session to the device, data buffer and data distribution source based on the master session identifier.

[0063] Copy session identifier: A unique number for the copy session. This copy session identifier is used to isolate view state and unbind subscriptions when the copy session exits.

[0064] Attribution mapping: Records the subordinate association between the replication session and the main session to avoid problems such as session confusion and illegal subscriptions.

[0065] Active replication session count: This represents the total number of replication sessions currently in an active state and serves as the basis for global consistency checks and determining whether data collection can be stopped.

[0066] Subscription relationship: Register the subscription handle and connection identifier of the replication session at the distribution layer to ensure proper decoupling and disconnection when the session exits.

[0067] Data Acquisition Run Flag: Marks the start and stop status of the data acquisition task. It can be linked with the status of UI (interface) buttons and work together to complete the final release of resources.

[0068] View state container: Independently stores snapshots of display parameters for a single copy session, enabling multi-view differentiated display of data from the same source.

[0069] In some embodiments of this application, after the replication session reads the data collected by the main session through a read-only interface and displays it through the replication view window during the replication session's operation, the method further includes: Step S700: If the replication session initiates a request to adjust globally effective configuration parameters, the parameter change will be processed uniformly through the change entry provided by the main session. The replication session cannot directly perform parameter writing operations.

[0070] In some embodiments of this application, step S400 includes: Step S401: When a close window instruction is received for the copy view window, the copy view window is closed. The subscription relationship of the corresponding copy session is retrieved and released according to the copy session identifier corresponding to the copy view window, and the subscription relationship is removed from the subscription relationship list. The local cache and view state container resources of the copy view window are released, and the entry corresponding to the copy session is deleted from the ownership mapping list.

[0071] Step S402: If a reference counting mechanism is used, the number of active replication sessions is decremented by one.

[0072] Step S403: During the execution of the window closing instruction, the main session and the data acquisition thread continue to run, and the other copy sessions also remain operational.

[0073] The following details the execution flow of exiting and decoupling the copy session and the corresponding copy view window, including: Triggering conditions: The user manually closes the copy view window, performs a copy session uninstallation, or the system actively destroys the copy session.

[0074] Processing actions: 1) Retrieve the corresponding subscription relationship based on the replication session identifier, unsubscribe from the data distribution layer, disconnect the signal and callback connection, and remove the subscription relationship from the subscription relationship list; 2) Release the local cache resources of the currently copied view window and the corresponding view state container resources; 3) Remove the slave entry corresponding to this replication session from the owner mapping list; 4) If a reference counting mechanism is used, the number of active replication sessions will be decremented by one; 5) Do not perform operations such as stopping data collection or closing device connections throughout the entire process, and isolate the view destruction from the underlying data collection link.

[0075] Output / Postconditions: The remaining replication sessions and the main session continue to run normally, and the connection between the underlying acquisition thread and the device is not affected by the destruction of the replication session.

[0076] Anomaly and boundary handling: Even if there is only one copy session left and the copy view window needs to be closed to return to the single main window mode, the core control logic of this invention is still followed. That is, the decision to stop data acquisition and disconnect the device is controlled only by the main session and is not implicitly triggered by the operation of closing the copy view window.

[0077] In some embodiments of this application, performing a global consistency check to confirm the absence of active replication session subscription relationships includes: Step S501: Perform a global consistency check.

[0078] The global consistency check includes checking whether the number of active replication sessions is zero, whether the subscription relationship list is empty, and whether there are any entries corresponding to replication sessions that have not been deleted remaining in the attribution mapping list. If all the check results are that there is no residual content, then it is checked whether there are any unfinished asynchronous distribution callbacks pointing to the cancelled replication sessions.

[0079] Specifically, global consistency checks can employ the following resource release determination logic: Let C be the number of active replication sessions (a non-negative integer). Mark R=1 when the master session initiates a release request, S=1 when the subscription list is empty, and F=1 when final resource release is allowed. The constraint rule is: the collection resource can only be released if the master session initiates a release request, and there are no active replication sessions and the subscription list is empty.

[0080] In the above constraint rules, the judgment condition takes effect when the number of active replication sessions, C, is 0; otherwise, it does not take effect. All conditions are logically ANDed. In practical applications, additional verification conditions such as no pending asynchronous dispatch callbacks and a zero device handle reference count can be added.

[0081] The logic for determining resource release is clear: the cessation of data collection and the release of resources are subject to hard preconditions of no active replication sessions and no valid subscription status, and are not affected by the timing or order of window closure.

[0082] Step S502: If the verification result is that it does not exist, then it is confirmed that there is no active replication session subscription relationship.

[0083] Step S503: If the verification result is that it exists, the global consistency check is re-executed in the next event loop, and the subscription relationship status of the active replication session is determined based on the result of the re-executed global consistency check.

[0084] The following details the execution flow of the global consistency check phase, including: Triggering conditions: The main session receives explicit resource release commands such as stop data collection, close the main session, or exit the program.

[0085] Processing actions: Before performing operations to stop mining or disconnect equipment, a global consistency check should be conducted. The check should include at least the following: 1) Check if the number of active replication sessions is zero and if the subscription relationship list is empty; 2) Check if there are any replication session entries in the attribution mapping list that have not yet been cancelled; 3) Check if there are any unfinished asynchronous dispatch callbacks pointing to a destroyed replication session. If so, you can choose to delay the check to the next event loop. 4) Check whether the detection device is still occupied by other modules. Other dependency verifications can be added as needed.

[0086] Output / Postconditions: The command to allow the final resource release can only be issued if all checks pass; if the checks fail, the user will be prompted to close the remaining copy view window or perform a forced termination operation according to the product policy.

[0087] By performing a global consistency check, the stop data collection operation can be transformed from a local interface event into a global resource management behavior, effectively preventing accidental termination of the underlying data collection chain due to misoperation.

[0088] In some embodiments of this application, the step of sequentially stopping the data acquisition thread and disconnecting from the device, and simultaneously releasing the data acquisition thread resources, device connection resources, and local view resources, includes: Step S504: Stop the data acquisition thread and refresh or discard any unfinished cached data; then close the device operation handle and disconnect the communication connection with the device; simultaneously unregister the entries belonging to the main session in the subscription relationship list, clean up the shared distribution object, and release the data acquisition thread resources, device connection resources, and local view resources.

[0089] The following details the execution flow of the final release phase, including: Triggering conditions: Global consistency check passes, and the main session confirms the execution of the termination operation.

[0090] Processing actions: 1) Stop the data acquisition thread; 2) Perform refresh or discard operations on unprocessed buffered data; 3) Close the device operation handle and disconnect the device; 4) Remove the corresponding entry for the main session from the subscription relationship list; 5) Clean up shared data distribution objects; 6) Notify the interface layer to complete the global state reset according to actual needs.

[0091] Output: All acquisition resources corresponding to the master session are completely released within the process. All replication sessions should have been cleaned up before or at this moment. Isolated replication sessions without a master session are not allowed.

[0092] Exception and boundary handling: If the device disconnection operation fails, a retry process will be initiated or an exception message will be reported; it is strictly prohibited to cause leakage of the acquisition thread handle resources if the subscription relationship is not completely terminated.

[0093] In some embodiments of this application, step S600 includes: Step S601: When it is confirmed that the copy session has exited abnormally, an idempotent cleanup operation is performed; wherein, the abnormal exit includes abnormal program exit caused by the crash of the copy view window, and abnormal offline caused by the forced termination of the child process corresponding to the copy session.

[0094] Step S602: Based on the replication session identifier corresponding to the replication session that exited abnormally, clear the residual subscription relationship and ownership mapping relationship, and re-complete the replication session creation and subscription relationship registration process; at the same time, pull the real-time data snapshot and buffer generation number from the main session and populate it back into the corresponding replication view window so as to restore the current replication view window to the display state before the abnormal exit, and the data interaction link is synchronously restored.

[0095] The following details the execution process for the anomaly reconstruction and rapid recovery phases, including: Triggering conditions: The copy view window crashes, exits abnormally, or is forcibly terminated by the user and then reopened.

[0096] Processing actions: 1) Before re-initiating access registration, perform an idempotent cleanup operation based on the replication session identifier to remove any remaining subscription relationships and attribution mapping relationships; 2) Complete the re-registration of the replication session subscription relationship according to the access registration process; 3) Retrieve the current data snapshot and buffer generation number from the main session and backfill the data in the copied view window to prevent blank or misaligned data from appearing on the interface.

[0097] Output: The copy view window shows that the link has returned to normal. Since the main session continues to run, there is no need to recreate the acquisition thread.

[0098] The shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device according to embodiments of the present invention can be divided into seven functional nodes. Each node has a clear division of labor and works in concert, fully covering the entire business path from session creation, normal operation, window exit, exception recovery, and global resource release. The specific functions of each node are described below: The main session hosting node exclusively maintains the connection between the acquisition thread and the device, and registers the data exit with the distribution layer; Replication session access node: Establish ownership mapping relationship, complete subscription relationship registration, and initialize view state container; Data distribution node: Distributes the unified data source to each replication session according to the subscription relationship list, either by push or pull. View isolation node: Isolates and persists the display parameters of each replication session; Exiting the decoupled node: unsubscribe from the subscription relationship, reclaim local resources, and update the active replication session statistics and ownership mapping relationship; Global consistency check node: After receiving the release command, it performs consistency checks on the number of active replication sessions and the subscription status; Final release node: When the release conditions are met, perform resource release operations such as stopping data acquisition and disconnecting device connections.

[0099] The above seven functional nodes work together to form a complete link, covering the entire process of creation, operation, exit, abnormal recovery and global release.

[0100] Based on the aforementioned seven functional nodes and the entire lifecycle operation logic, this invention achieves engineering implementation through a modular architecture. The overall system is divided into six functional modules, each with clearly defined responsibilities and mutual collaboration, fully supporting session management, shared data acquisition, data distribution, view isolation, lifecycle control, and anomaly recovery capabilities. The specific responsibilities and implementation methods of each functional module are as follows: The session relationship management module is responsible for uniformly maintaining the main session identifier, the replicated session identifier, and their attribution mapping relationship. It relies on the attribution mapping list and the subscription relationship list to realize session identity retrieval, subordinate relationship binding and unbinding, and support the uniqueness verification of the entire session process.

[0101] Shared data acquisition and hosting module: It exclusively maintains the device connection and data acquisition work thread in a single instance, ensuring the uniqueness of the underlying data acquisition link under the same device and the same main session, and providing underlying support for multiple replicated view windows to reuse the same source data acquisition capability.

[0102] Data distribution module: Based on the subscription relationship list mechanism, it synchronously distributes a single data source to each replication session through event broadcasting, signal slots and callback lists, realizing the data distribution capability of single-point output and multi-point display.

[0103] View Isolation Module: Configures an independent view state container for each replication session, isolates and persists personalized display parameters of each replication view window through a UI state object tree, and realizes multi-view differentiated display of data from the same source.

[0104] Lifecycle control module: As the core management and control module for the entire process, it uses a lifecycle state machine to uniformly realize the scheduling of the entire process, including session access registration, window exit decoupling, global consistency check, and resource final state release, and standardizes the timing of resource application and release.

[0105] Anomaly Recovery Module: Specifically responsible for self-healing logic in abnormal scenarios. Through recovery control processes such as idempotent cleanup, resubscription, and data snapshot backfilling, it achieves rapid recovery after a crash and restart of the copy view window without rebuilding the underlying data acquisition link.

[0106] The six modules work together to fully cover the entire business chain, including session creation, normal operation, window exit, abnormal reconstruction, and global resource release, achieving a multi-window shared acquisition architecture that is layered, decoupled, and has isolated responsibilities and is stable and controllable.

[0107] This invention provides a method for shared data acquisition and independent view lifecycle isolation management for multi-window replication on the same device. It enables duplicate data acquisition without duplication in multi-view window replication mode on the same device, effectively reducing resource consumption. Furthermore, closing a replicated view window does not interrupt the main acquisition task, ensuring strong system stability. Each replication session relies on a shared data source, guaranteeing consistency of basic data across all replicated view windows. In addition, the lifecycle decoupling design significantly improves recovery capabilities in abnormal scenarios, while the overall architecture possesses good scalability, facilitating the addition of various observation views in the future.

[0108] It should be noted that the shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device in this embodiment of the invention supports different alternatives for multiple steps, including: the shared layer can be replaced by a publish-subscribe bus or a shared memory service; lifecycle coordination can adopt a lease model or a heartbeat model; state synchronization can adopt an event stream push, timed pull, or a hybrid synchronization method combining the two; in addition, the number of replication sessions can be dynamically limited according to device performance.

[0109] The following describes in detail specific embodiments based on the overall architecture of the shared acquisition and independent view lifecycle isolation management method for multi-window replication on the same device provided by the present invention.

[0110] Example 1: Shared data collection based on session registry, reference counting mechanism and subscription relationship list.

[0111] Application Scenario: The logic analyzer's host computer has already created a main session for the same device and completed the device opening (openDevice) / startCapture operations. The user can create multiple copy view windows via menus or buttons (each copy view window corresponds to a copy session). This scenario requires full reuse of existing links, eliminating the need to repeatedly create device connections and data acquisition threads.

[0112] (1) Session Registry (Centralized Index) Maintaining a session registry within the process (containing two core types of content: ownership mapping and subscription relationships, used to manage session affiliation and data distribution subscription relationships, respectively) can be implemented using a hash table. The session registry retrieval key must at least include: Device identifier (D): such as USB serial number, device handle number, or communication port identifier; Master session identifier (M): Globally unique within the process, it can be an incrementing session number or a globally unique identifier GUID.

[0113] Key-value pair ((D,M)): The corresponding stored content value must contain at least: Shared data acquisition service objects: encapsulated device connections, data acquisition threads, circular or segmented buffers, and data reading interfaces; Active replication session count (C): Unsigned integer, initialized to 0; Subscription relationship list (L): Records the identifiers of each replication session, used for targeted data distribution or disconnection.

[0114] (2) Specific steps for creating a replication session After a user triggers the copy / create copy view window, the UI layer generates a copy session identifier (V). This copy session identifier (V) is different from the main session identifier (M) and is used to achieve view isolation.

[0115] The business layer retrieves the session registry based on the key-value pair ((D,M)). If the retrieval is successful, the number of active replication sessions C is incremented by 1 (C\leftarrowC+1), the replication session identifier (V) is added to the subscription relationship list (L), and a read-only interface / subscription relationship handle pointing to the same shared acquisition service object is returned. The device opening and acquisition thread creation are not called repeatedly. If the retrieval is unsuccessful (abnormal path), the key-value pair ((D,M)) is initialized according to the main session creation process first, and then step (2) is executed.

[0116] (3) Specific steps to close the copy view window Before the UI destroys the replication view window, the business layer removes the corresponding entry from the subscription relationship list (L) based on the replication session identifier (V) and decrements the active replication session count C by 1 (C\leftarrowC-1). Simultaneously, it unbinds the replication session from the shared data channel, disconnects the signal and callback connections, and avoids performing operations such as stopCapture / closeDevice throughout the process.

[0117] The shared acquisition service object and device connection are only allowed to be released when the main session enters the explicit stop process and the number of active replication sessions C is 0 (C=0) (or the main session's preset rules are met).

[0118] (4) Concurrency and Consistency Measures Read and write operations on the session registry are controlled using mutexes or read-write locks to ensure that updates to the active replication session count (C) and the subscription relationship list (L) are atomic. The data distribution side can adopt a single-write, multiple-read mode: the data acquisition thread writes exclusively to the shared buffer. Each replication session only reads the snapshot descriptor (pointer + length + generation number) in the subscription callback to avoid the read process occupying lock resources for a long time.

[0119] Verifiable technical effects: The operational logic can be intuitively verified by observing the number of active replication sessions (C) and the subscription relationship list (L). That is, changes in the number of replication sessions will not lead to repeated chain building, and partial shutdown only affects the number of active replication sessions (L) and the subscription relationship list (C), which is completely decoupled from the underlying collection start and stop logic.

[0120] Example 2: Data distribution and replication session lifecycle binding based on event subscription mechanism (taking Qt signal slots as an example).

[0121] Application scenarios: The main session corresponds to an independent session business object (such as a session instance running on a worker thread), which continuously generates notifications such as drawing updates, decoding appends, and acquisition progress; multiple copied view windows need to receive notifications from the same source in parallel, but each maintains independent display parameters, scaling ratios, and cursor states to achieve view isolation.

[0122] (1) Signal publishing end (main session side) The shared data acquisition service object exposes its data update capabilities to the outside world in the form of event signals. Examples of specific event signal names are as follows: Data / waveform refresh signal (carrying data frame sequence number or buffer generation number); Decode entry append signal (carrying a read-only reference to the shared data block or an immutable shared block identifier); Collect operational status signals (running / paused / completed / abnormal).

[0123] When event signals are emitted in the context of the acquisition thread or worker thread, they must meet the thread safety constraints under that thread model (e.g., deliver the notification to the thread where each replicated view window is located through a queue connection Qt::QueuedConnection) to ensure safe and reliable cross-thread data interaction.

[0124] (2) Slot subscription end (each copy session side) Each duplicate view window holds its own independent view controller and view state container.

[0125] When creating a replication session and completing access registration: Use connect(shared session object, signal, current view controller, slot, QueuedConnection) to establish a subscription relationship between the main session and the current replicated session slot function; Within the slot function, only the view state container (zoom, scroll offset, cursor, selected item) of the copied view window is updated, without modifying any shared acquisition parameters or the main session state.

[0126] (3) Explicit subscription disconnection when copy view window is closed The `disconnect` function or its equivalent is invoked in the copy view window's destruction path to precisely disconnect the signal subscription connection between the current view controller and the shared session object. This accurately terminates the subscription relationship of the current copy session, preventing crashes caused by dangling callbacks and dangling pointer access caused by the destroyed copy view window still receiving signals. A single `disconnect` operation will not affect the main session's acquisition task, nor will it stop the underlying acquisition thread's connection to the device.

[0127] (4) Abnormal Reconstruction and Quick Recovery (Reopening after the Copy View Window crashes) If a replication session exits abnormally without disconnecting from the subscription, idempotent cleanup can be performed the next time the same replication session is started. This involves retrieving residual subscriptions and ownership mappings from the session registry based on the current replication session identifier (V). After re-establishing the signal subscription connection, pull the current data snapshot (recent buffer pointer / generation number) from the shared session and populate it back into the current replicated view window to restore the display state before the abnormal exit and avoid blank or misaligned interfaces.

[0128] (5) Connection with Example 1 The subscription relationship list (L) in Implementation Example 1 can store the subscription handle (connection ID or weak reference to the view controller) for each replication session. When the replication view window is closed, explicit disconnect operations can be performed in batches based on the subscription handles, ensuring that the exit decoupling process can be performed in a standardized, traceable, and log-auditable manner, achieving unified control over the lifecycle and subscription management.

[0129] Please see Figure 2 As shown, it is a schematic diagram of the structure of an electronic device in the hardware operating environment involved in the embodiment of the present invention.

[0130] In this embodiment, an electronic device includes: Memory 1005 is used to store program instructions; and Processor 1001 is used to execute the program instructions to implement the steps of the shared acquisition and independent view lifecycle isolation management method for multi-window copying on the same device as described above.

[0131] The electronic device in this embodiment of the invention can be a desktop computer, laptop, handheld computer, server, or other computing device. Figure 2 As shown, the electronic device may include: a processor 1001 (e.g., a CPU), a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit, such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0132] Those skilled in the art will understand that Figure 2 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0133] like Figure 2 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and computer programs.

[0134] exist Figure 2In the electronic device shown, the network interface 1004 is mainly used to connect to the backend server and communicate with the backend server; the user interface 1003 is mainly used to connect to the client (user terminal) and communicate with the client; and the processor 1001 can be used to call the computer program stored in the memory 1005. When the computer program is called and executed by the processor 1001, it implements the steps of the above-mentioned shared acquisition and independent view lifecycle isolation management method for multi-window copying of the same device.

[0135] The following are embodiments of the computer-readable storage medium provided by the present invention. The embodiments of the computer-readable storage medium belong to the same concept as the above-described embodiments of the shared acquisition and independent view lifecycle isolation management method and electronic device for multi-window replication on the same device. Details not fully described in the embodiments of the computer-readable storage medium can be found in the above-described embodiments of the shared acquisition and independent view lifecycle isolation management method and electronic device for multi-window replication on the same device.

[0136] In this embodiment, a computer-readable storage medium stores computer-executable instructions thereon. When executed by a processor, the computer-executable instructions implement the steps of the shared acquisition and independent view lifecycle isolation management method for multi-window copying on the same device as described above.

[0137] The electronic device and computer-readable storage medium of the present invention are both capable of implementing the steps of the above-described method for shared acquisition and independent view lifecycle isolation management for multi-window copying of the same device. Therefore, they at least have all the beneficial effects brought about by the technical solutions of the above-described method for shared acquisition and independent view lifecycle isolation management for multi-window copying of the same device, which will not be repeated here.

[0138] The above description is only a part or preferred embodiment of the present invention. Neither the text nor the drawings should limit the scope of protection of the present invention. All equivalent structural transformations made using the content of the present invention specification and drawings under the overall concept of the present invention, or direct / indirect applications in other related technical fields, are included within the scope of protection of the present invention.

[0139] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program goods. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs) containing computer-usable program code. The form of computer program products implemented on ROM, optical memory, etc.

[0140] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program goods according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0141] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0142] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.

Claims

1. A method for shared acquisition and independent view lifecycle isolation management for multi-window replication on the same device, characterized in that, include: In response to receiving a request to create a main session, a main session is created; wherein, the main session is used to establish a connection with an external device, continuously collect data through the device, and maintain the collection status during the data collection process; When a request to create a replication session is received, a replication session and a corresponding replication view window are created, and a corresponding replication session identifier is generated; the subscription relationship between the replication session and the main session is registered according to the replication session identifier; wherein, the main session can establish subscription relationships with multiple replication sessions; During the replication session, the replication session reads the data collected by the main session through a read-only interface and displays the data through the replication view window; and if a user interaction command is received, modification of the view state container of the replication session is only allowed. When a close window command is received for the copied view window, the copied view window is closed, the subscription relationship of the copied session is terminated, and the local view resources of the copied view window are released, while the main session and the data acquisition thread continue to run. When the main session receives a command to stop data acquisition or close the session, a global consistency check is performed to confirm that there is no active replication session subscription relationship. Then, the data acquisition thread is stopped and the connection with the device is disconnected in sequence, and the data acquisition thread resources, device connection resources and local view resources are released simultaneously. When it is confirmed that the copy session has exited abnormally, an idempotent cleanup operation is performed to remove residual subscription relationships; the subscription relationship is re-established, and the original display state of the copy view window corresponding to the copy session is restored.

2. The method for shared acquisition and independent view lifecycle isolation management for multi-window replication on the same device according to claim 1, characterized in that, The response to receiving a request to create a main session, and the creation of a main session, includes: In response to receiving a request to create a main session, a main session is created, and a connection is established between the main session and an external device to continuously collect data uniformly through the device, and to maintain the collection status during the data collection process; wherein, maintaining the collection status includes the main session negotiating collection parameters, managing the data collection thread, uniformly generating raw data and decoded data, and providing read-only interfaces and subscribed data channels to each replica session.

3. The method for shared acquisition and independent view lifecycle isolation management for multi-window replication on the same device according to claim 1, characterized in that, When a request to create a replication session is received, a replication session and a corresponding replication view window are created, and a corresponding replication session identifier is generated. Registering the subscription relationship between the replication session and the main session based on the replication session identifier includes: When a request to create a replication session is received, it is determined whether a primary session has already been created. If a copy session has already been created, a copy session and a corresponding copy view window are created, and a corresponding copy session identifier is generated synchronously. Based on the copy session identifier, an attribution mapping relationship corresponding to the main session is constructed, and the subscription relationship registration between the copy session and the main session is completed. The constructed attribution mapping relationship is stored in a preset attribution mapping list, and the registered subscription relationship is stored in a preset subscription relationship list. If a reference counting mechanism is used, the number of active replication sessions will be incremented by one, and the read-only interface handle of the master session will be sent to the replication session. If the subscription registration operation fails, the established ownership mapping relationship will be rolled back; if a reference counting mechanism is used, the number of active replication sessions will be decremented by one, and a warning message will be output to avoid abnormal hanging states.

4. The method for shared acquisition and independent view lifecycle isolation management for multi-window replication on the same device according to claim 1, characterized in that, During the execution of the replication session, after the replication session reads the data collected by the main session through a read-only interface and displays it through the replication view window, the process further includes: If the replication session initiates a request to adjust globally effective configuration parameters, the parameter change will be processed uniformly through the change entry provided by the main session. The replication session cannot directly perform parameter write operations.

5. The method for shared acquisition and independent view lifecycle isolation management for multi-window replication on the same device according to claim 3, characterized in that, When a close window command is received for the copied view window, the copied view window is closed, the subscription relationship of the copied session is terminated, and the local view resources of the copied view window are released, while the main session and data acquisition thread continue to run, including: When a close window command is received for the copied view window, the copied view window is closed. The subscription relationship of the corresponding copied session is retrieved and released according to the copy session identifier corresponding to the copied view window, and the subscription relationship is removed from the subscription relationship list. The local cache and view state container resources of the copied view window are released, and the entry corresponding to the copied session is deleted from the ownership mapping list. If a reference counting mechanism is used, the number of active replication sessions will be decremented by one; During the execution of the window closing command, the main session and data acquisition thread continue to run, and the other copy sessions also remain operational.

6. The method for shared acquisition and independent view lifecycle isolation management for multi-window replication on the same device according to claim 5, characterized in that, The execution of a global consistency check to confirm the absence of active replication session subscription relationships includes: Perform a global consistency check; wherein, the global consistency check includes checking whether the number of active replication sessions is zero, whether the subscription relationship list is empty, and whether there are any entries corresponding to replication sessions that have not been deleted remaining in the attribution mapping list; if all the check results are no residual content, then check whether there are any unfinished asynchronous distribution callbacks pointing to the cancelled replication sessions; If the verification result is that it does not exist, then it is confirmed that there is no active replication session subscription relationship; If the verification result is positive, the global consistency check will be re-executed in the next event cycle, and the subscription relationship status of the active replication session will be determined based on the result of the re-executed global consistency check.

7. The method for shared acquisition and independent view lifecycle isolation management for multi-window replication on the same device according to claim 5, characterized in that, The sequential cessation of the data acquisition thread and disconnection from the device, along with the simultaneous release of data acquisition thread resources, device connection resources, and local view resources, includes: Stop the data acquisition thread and refresh or discard any unfinished cached data; then close the device operation handle and disconnect the communication connection with the device; simultaneously unregister the entries belonging to the main session in the subscription relationship list, clean up the shared distribution object, and release the data acquisition thread resources, device connection resources, and local view resources.

8. The method for shared acquisition and independent view lifecycle isolation management for multi-window replication on the same device according to claim 1, characterized in that, When it is confirmed that the replication session has exited abnormally, an idempotent cleanup operation is performed to remove residual subscription relationships; Re-establish the subscription relationship and restore the original display state of the copy view window corresponding to the copy session, including: When it is confirmed that the copy session has exited abnormally, an idempotent cleanup operation is performed; wherein, the abnormal exit includes abnormal program exit caused by the crash of the copy view window, and abnormal offline caused by the forced termination of the child process corresponding to the copy session. Based on the replication session identifier corresponding to the replication session that exited abnormally, the residual subscription relationships and ownership mapping relationships are cleared, and the replication session creation and subscription relationship registration process is completed again. At the same time, real-time data snapshots and buffer generation numbers are pulled from the main session and populated back into the corresponding replication view window so as to restore the current replication view window to the display state before the abnormal exit, and the data interaction link is restored synchronously.

9. An electronic device, characterized in that, include: Memory, used to store program instructions; as well as A processor for executing the program instructions to implement the steps of the shared acquisition and independent view lifecycle isolation management method for multi-window replication of the same device as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the steps of the shared acquisition and independent view lifecycle isolation management method for multi-window copying of the same device as described in any one of claims 1 to 8.