Monitoring page display methods, electronic devices, and storage media
By instantiating skeleton objects and updating target persistent fields in the Open Harmony system, and combining business logic singleton objects to independently access the file system, the problem of the data monitoring system being unable to restore the monitoring page after a power outage and restart was solved. This enabled accurate recovery of information before the power outage, improving the system's power outage recovery capability and the reliability of data monitoring.
Patent Information
- Application Number
- CN202610305962.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-13
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2046-03-13
AI Technical Summary
The existing data monitoring system based on the Open Harmony system only loads static configuration files after an unexpected power outage and restart, causing the monitoring page to display default initialization content and making it impossible to restore the monitoring status before the power outage, resulting in a gap in monitoring visualization.
By instantiating a skeleton object and obtaining state snapshot data when the monitoring system application starts, updating mismatched target persistent fields, and using a business logic singleton object to independently access the file system, the information before the power outage is rendered as configuration information on the page when the power outage restarts.
It effectively improves the power outage recovery capability of the data monitoring system, prevents monitoring visualization gaps, ensures that the page displays the information before the power outage when restarting, and enhances the system's reliability and data integrity.
Smart Images

Figure CN122365481B_ABST
Abstract
Description
Technical Field
[0001] This application relates to, but is not limited to, the field of data monitoring technology, and in particular to a monitoring page display method, electronic device, and storage medium. Background Technology
[0002] In related technologies, with the release of excellent domestic operating systems such as Open Harmony and the promotion of localization and information technology innovation, data monitoring systems developed using the Open Harmony system are used in domestic substations, power distribution rooms and other scenarios for data monitoring.
[0003] Existing data monitoring systems developed based on the Open Harmony system often only load static configuration files after an unexpected power outage and restart. In this case, the data monitoring system will only display the default initialization content after restarting and will not display the situation before the unexpected power outage. Then it will directly collect the current data and display the current situation, resulting in a gap in the data monitoring visualization. Summary of the Invention
[0004] This application provides a monitoring page display method, an electronic device, and a storage medium, aiming to improve the power failure recovery capability of the data monitoring system.
[0005] On one hand, embodiments of this application provide a method for monitoring page display, including: In response to the startup of the monitoring system application and its entry into the creation lifecycle, the static configuration information of the monitoring system application is instantiated to obtain a skeleton object of multiple industrial data measurement points; Get status snapshot data; For each skeleton object, the skeleton object is compared with the state snapshot data. In response to the skeleton object not matching the state snapshot data, the target persistent field corresponding to the skeleton object in the state snapshot data is determined, and the skeleton object is updated according to the determined target persistent field. The monitoring page is displayed based on the current multiple skeleton objects.
[0006] In one embodiment, the method further includes: In response to changes to the skeleton object in the monitoring page that are not real-time data, the changed content is written to the skeleton object; The current state snapshot data is overwritten and updated based on the current skeleton object.
[0007] In one embodiment, the method further includes: In response to the skeleton object not having corresponding content in the state snapshot data, the skeleton object is maintained.
[0008] In one embodiment, before instantiating the static configuration information of the monitoring system application, the method further includes: Instantiate the business logic singleton based on its configuration information to obtain the business logic singleton object; Obtain the application file sandbox path configuration information in the monitoring system application; The application file sandbox path is injected into the business logic singleton object according to the application file sandbox path configuration information to obtain the business logic singleton object configured with the application file sandbox path, wherein the current business logic singleton object is used for skeleton object instantiation.
[0009] In one embodiment, the method further includes: In response to the monitoring system application detecting a power supply anomaly, a state snapshot of the current multiple skeleton objects is performed through the business logic singleton object.
[0010] In one embodiment, the step of monitoring page display based on the current plurality of skeleton objects includes: Obtain the multi-view configuration information of the monitoring system application, wherein the multi-view configuration information includes view configuration content of multiple industrial data measurement points, and the view configuration content includes measurement point ID; The multiple measurement point IDs are deduplicated and traversed to obtain multiple distinct target measurement point IDs; The UI component is instantiated based on the view configuration content of the multiple target measurement point IDs, wherein the UI component is bound to one or more of the current multiple skeleton objects; The monitoring page is displayed based on the UI components and the corresponding bound skeleton objects.
[0011] In one embodiment, the step of performing a deduplication traversal on the plurality of measurement point IDs to obtain a plurality of distinct target measurement point IDs includes: Each of the measured point IDs is traversed, and during the traversal, if the measured point IDs encountered do not have the same measured point IDs in the preset physical index set, the measured point IDs are added to the physical index set. In response to the completion of the traversal of the measurement point IDs, the measurement point ID in the physical index set is determined as the target measurement point ID.
[0012] In one embodiment, the method further includes: In response to the fact that the current monitoring page has displayed a preset duration, industrial data is retrieved based on the skeleton object corresponding to each UI component on the monitoring page; The monitoring page is re-rendered based on the currently retrieved industrial data.
[0013] On the other hand, embodiments of this application also provide an electronic device, including: at least one processor; at least one memory for storing at least one program; and implementing the monitoring page display method as described above when at least one of the programs is executed by at least one of the processors.
[0014] On the other hand, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions, characterized in that the computer-executable instructions are used to execute the monitoring page display method as described above.
[0015] On the other hand, embodiments of this application also provide a computer program product, including a computer program or computer instructions, wherein the computer program or computer instructions are stored in a computer-readable storage medium, a processor of an electronic device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions to cause the electronic device to perform the monitoring page display method as described above.
[0016] This application provides a monitoring page display method, electronic device, and storage medium. The method includes, in response to the startup of a monitoring system application and its entry into a creation lifecycle, instantiating the static configuration information of the monitoring system application to obtain skeleton objects of multiple industrial data measurement points, acquiring state snapshot data, and for each skeleton object, performing a field comparison between the skeleton object and the state snapshot data. In response to a mismatch between the skeleton object and the state snapshot data, determining the target persistent field corresponding to the skeleton object in the state snapshot data, updating the skeleton object according to the determined target persistent field, and displaying a monitoring page based on the current multiple skeleton objects. By instantiating a skeleton object using static configuration information after the monitoring system application starts, and adding target persistent fields from the status snapshot data that do not match the current skeleton object to the skeleton object, the existing target persistent fields before startup can be used as configuration information to populate the skeleton object. In this way, when power is lost and restarted, the information before the power outage can be used as part of the skeleton object's configuration information for page rendering. This allows the page displayed during a power outage to remain on the monitoring page before the power outage, effectively improving the power outage recovery capability of the data monitoring system and thus effectively suppressing monitoring visualization gaps. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating a method for monitoring page display according to an embodiment of this application; Figure 2 This is a flowchart illustrating a method for monitoring page display according to another embodiment of this application; Figure 3 This is a flowchart illustrating a method for monitoring page display provided in another embodiment of this application; Figure 4 yes Figure 1 A flowchart illustrating an embodiment of a sub-step of step 140; Figure 5 This is a flowchart illustrating a method for monitoring page display provided in yet another embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0019] It should be noted that although the flowchart shows a logical order, in some cases, the steps shown or described may be executed in a different order than that shown in the flowchart. In the description of the embodiments of this application, "multiple" (or more than) means two or more, "greater than," "less than," and "exceeding" are understood to exclude the number itself, while "above," "below," and "within" are understood to include the number itself. If "first," "second," etc., are described, they are only used to distinguish technical features and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or the order of the technical features indicated. Furthermore, in the description of the embodiments of this application, the various values mentioned (such as first value, second value, etc.) can be flexibly represented as a single numeric code or an enumerated type value.
[0020] In related technologies, with the release of excellent domestic operating systems such as Open Harmony and the promotion of localization and information technology innovation, data monitoring systems developed using the Open Harmony system are used in domestic substations, power distribution rooms and other scenarios for data monitoring.
[0021] Existing data monitoring systems developed based on the Open Harmony system often only load static configuration files after an unexpected power outage and restart. In this case, the data monitoring system will only display the default initialization content after restarting and will not display the situation before the unexpected power outage. Then it will directly collect the current data and display the current situation, resulting in a gap in the data monitoring visualization.
[0022] To improve the power outage recovery capability of data monitoring systems, embodiments of this application provide a monitoring page display method, an electronic device, a computer-readable storage medium, and a computer program product. The method includes, in response to the startup of a monitoring system application and its entry into its creation lifecycle, instantiating the static configuration information of the monitoring system application to obtain skeleton objects of multiple industrial data measurement points, acquiring state snapshot data, and for each skeleton object, performing field comparisons between the skeleton object and the state snapshot data. In response to a mismatch between the skeleton object and the state snapshot data, determining the target persistent field corresponding to the skeleton object in the state snapshot data, updating the skeleton object according to the determined target persistent field, and displaying a monitoring page based on the current multiple skeleton objects. By instantiating a skeleton object using static configuration information after the monitoring system application starts, and adding target persistent fields from the status snapshot data that do not match the current skeleton object to the skeleton object, the existing target persistent fields before startup can be used as configuration information to populate the skeleton object. In this way, when power is lost and restarted, the information before the power outage can be used as part of the skeleton object's configuration information for page rendering. This allows the page displayed during a power outage to remain on the monitoring page before the power outage, effectively improving the power outage recovery capability of the data monitoring system and thus effectively suppressing monitoring visualization gaps.
[0023] See Figure 1 , Figure 1 The flowchart illustrates a method for monitoring page display according to an embodiment of this application. In this embodiment, the method for monitoring page display may include the following steps.
[0024] Step 110: In response to the startup of the monitoring system application and its entry into the creation lifecycle, the static configuration information of the monitoring system application is instantiated to obtain the skeleton objects of multiple industrial data measurement points; Step 120: Obtain state snapshot data; Step 130: For each skeleton object, perform field comparison of the skeleton object based on the state snapshot data. In response to the mismatch between the skeleton object and the state snapshot data, determine the target persistent field corresponding to the skeleton object in the state snapshot data, and update the skeleton object according to the determined target persistent field. Step 140: Monitor the page display based on the current multiple skeleton objects.
[0025] In one embodiment, monitoring system application startup refers to the operation of loading and starting the data monitoring system after the hardware device equipped with the data monitoring system is powered on. This loading and startup can be the initial power-on startup of the hardware device, or the startup after a power outage and subsequent power-on, etc., and is not specifically limited here.
[0026] In one embodiment, static configuration information refers to a set of information containing the attribute loading configurations corresponding to all industrial data measurement points to be displayed by the data monitoring system. For example, if the data monitoring system needs to display the status of a measurement point, then, according to the actual situation, this measurement point needs to display temperature and humidity data and perform temperature and humidity monitoring. Therefore, this measurement point needs to have two static attributes (temperature and humidity thresholds) and two dynamic attributes (temperature and humidity). The temperature and humidity attributes also need to be bound to the mapping relationship of the actual temperature and humidity sensors of the measurement point. This set of information forms the data attribute loading configuration of this measurement point.
[0027] In one embodiment, a skeleton object refers to a data framework containing multiple monitoring attributes of a single measurement point, possessing the ability to define static attributes and acquire dynamic attribute data. It should be noted that the attributes contained in the skeleton objects of multiple industrial data measurement points can be the same or different; no specific limitation is made here. It should also be noted that the skeleton object is a dependency of the UI page instance; the real-time industrial data that the UI page needs to display must be retrieved from the backend through the skeleton object.
[0028] In one embodiment, a mismatch between the skeleton object and the state snapshot data refers to a situation where, in addition to the data collected in real time, the state snapshot data contains content that is different from or different from the content in the current skeleton object. For example, if a skeleton object has a default alarm threshold set, and the user manually changed it to an alarm threshold different from the default threshold during the last use of the data monitoring system, this constitutes a mismatch between the skeleton object and the state snapshot data. As another example, if the data monitoring system has the ability to add attributes to the skeleton object during operation, and the user manually added a measurement point to display light intensity data during the last use of the data monitoring system, the skeleton object can be additionally augmented with light intensity attributes, light intensity threshold attributes, and light intensity threshold values, in addition to the default attributes. This also constitutes a mismatch between the skeleton object and the state snapshot data.
[0029] In one embodiment, a target persistent field refers to a field containing non-real-time data added to the skeleton object when using the monitoring system application, compared to the default skeleton object instantiated based on static configuration information. Continuing with the previous example, the light intensity attribute, light intensity threshold attribute, and light intensity threshold value in that example are all target persistent fields, while the light data that is fixed to the light intensity attribute in real time in the status snapshot data is not a target persistent field.
[0030] In one embodiment, updating the skeleton object according to the determined target persistent field refers to the operation of injecting the target persistent field into the default skeleton object to form a new skeleton object.
[0031] In one embodiment, displaying the monitoring page based on multiple skeleton objects refers to generating multiple UI components based on the view configuration file, and rendering the page based on the multiple UI components and multiple skeleton objects to obtain the operation that can display the monitoring page that was last temporarily displayed before the monitoring system application started.
[0032] It should be noted that if the monitoring system application is launched for the first time, step 120 will still be performed, but the obtained state snapshot data will be empty. In this case, the final skeleton object will be the same as the default skeleton object. If the monitoring system application is not launched for the first time (e.g., due to an unexpected power outage or normal power-off), the skeleton object will be restored to the skeleton object before the last power-off.
[0033] In one embodiment, the skeleton object is maintained in response to the absence of corresponding content in the state snapshot data. Specifically, when the skeleton object has no corresponding content in the state snapshot data, the attribute loading configuration information corresponding to the skeleton object was manually added to the static configuration information by the user before the monitoring system application started. Therefore, the state snapshot data will not contain corresponding data. In this case, the skeleton object is displayed on the monitoring page as a new skeleton object with the default configuration.
[0034] See Figure 2 , Figure 2 The flowchart of a method for monitoring page display according to another embodiment of this application is shown. In one embodiment, the method for monitoring page display may further include the following steps.
[0035] Step 210: In response to changes to non-real-time data on the skeleton object in the monitoring page, write the changes to the skeleton object. Step 220: Update the current state snapshot data based on the current skeleton object.
[0036] In one embodiment, modifying non-real-time data of a skeleton object on a monitoring page refers to a user's operation of changing content on the currently displayed page of the monitoring system application that is not based on real-time data fed back from measurement points. This non-real-time data may include attribute fields, attribute thresholds, etc., without specific limitations here. For example, if a user changes "Temperature" on the page to "Temperature" and changes the temperature reference value from "60 to 70" to "65 to 70," these modifications are changes to measurement data that is not collected and displayed in real time, i.e., changes to non-real-time data.
[0037] In one embodiment, writing changes to the skeleton object refers to modifying the corresponding fields in the skeleton object by returning the content entered on the currently displayed page of the monitoring system application to the skeleton object.
[0038] In one embodiment, updating the current state snapshot data based on the current skeleton object means updating the portion of the state snapshot data corresponding to the current skeleton object, without updating the corresponding portions of other content in the state snapshot data. It is important to note that updating the current state snapshot data based on the current skeleton object is a triggered update, which can occur as an interrupt event outside the state snapshot period.
[0039] By writing changes to the skeleton object and updating the current state snapshot data accordingly, the current skeleton object can be backed up to the snapshot data in a timely manner. In this way, even before the snapshot period is over, the changes can be persistently stored without modifying the static configuration information, so that the previously modified content can be accurately restored after an unexpected power outage and restart.
[0040] See Figure 3 , Figure 3 The flowchart of a method for monitoring page display according to another embodiment of this application is shown. In one embodiment, the method for monitoring page display may further include the following steps.
[0041] Step 310: Instantiate the business logic singleton based on its configuration information to obtain the business logic singleton object; Step 320: Obtain the application file sandbox path configuration information in the monitoring system application; Step 330: Inject the application file sandbox path into the business logic singleton object according to the application file sandbox path configuration information to obtain the business logic singleton object configured with the application file sandbox path. The current business logic singleton object is used for skeleton object instantiation.
[0042] In one embodiment, instantiating a business logic singleton object based on its configuration information refers to the operation of generating the business logic singleton object through its configuration information during the OnCreate lifecycle of the main program entry point of the monitoring system application. Here, the business logic singleton refers to a global logical instance responsible for core business processing within the monitoring system application.
[0043] In one embodiment, obtaining the application file sandbox path configuration information in the monitoring system application refers to the operation of using the monitoring system's context capabilities to retrieve the application file sandbox path configuration information during the OnCreate lifecycle of the main program entry point of the monitoring system application. The application file sandbox path configuration information refers to information containing the absolute sandbox path of the monitoring system application in the file system.
[0044] In one embodiment, injecting the application file sandbox path into the business logic singleton object according to the application file sandbox path configuration information to obtain a business logic singleton object configured with the application file sandbox path refers to the operation of injecting the application file sandbox path into the memory space of the business logic singleton object and performing persistence processing. Specifically, at the application layer, the business logic singleton object, which is manifested as a data management module, can inject the string of the application file sandbox path into the memory space of the business logic singleton object through the initialization interface of the data management module, thereby enabling the business logic singleton object to obtain the ability to independently access the file system.
[0045] In one embodiment, after the monitoring system displays the monitoring page, in response to the monitoring system application detecting a power supply anomaly, a state snapshot of the current multiple skeleton objects is performed through a business logic singleton object.
[0046] In the conventional development of data monitoring systems based on the Open Harmony system, file reading and writing often rely on a UI context isolated from the backend data collection service, making it difficult for the backend data collection service to obtain the sandbox path. However, data monitoring systems are designed from the outset to have the ability to save data even when power is off. During a power outage, the UI context becomes inoperable, preventing the backend data collection service from independently saving snapshot data. By injecting the application file sandbox path into the business logic singleton object during its creation lifecycle, the business logic singleton object can access the file system independently, freeing it from the dependency on the UI context. This allows it to directly save snapshot data through its own resided application file sandbox path during a power outage, thus achieving complete decoupling between the business logic and UI lifecycle. The business logic singleton object responsible for coordinating data can instantly gain persistence capabilities when the monitoring system starts. Even if the UI page is destroyed or not loaded, the underlying communication and data storage operations can still operate in a closed loop, ensuring the integrity of industrial terminal data.
[0047] See Figure 4 , Figure 4 It shows Figure 1 The process of a sub-step embodiment of step 140. In one embodiment, step 140 may include the following sub-step embodiments.
[0048] Step 410: Obtain the multi-view configuration information of the monitoring system application, wherein the multi-view configuration information includes the view configuration content of multiple industrial data measurement points, and the view configuration content includes the measurement point ID; Step 420: Perform a deduplication traversal on multiple measurement point IDs to obtain multiple distinct target measurement point IDs; Step 430: Instantiate components based on the view configuration content of multiple target measurement point IDs to obtain UI components, wherein the UI components are bound to one or more of the current multiple skeleton objects; Step 440: Display the monitoring page based on the UI components and their corresponding bound skeleton objects.
[0049] In one embodiment, the view configuration content refers to the logical hierarchy architecture configuration information contained in a monitoring page view. For example, a substation page view includes multiple devices, each device has multiple contacts used as measurement points, forming a topology of "substation => device => contact". Each level contains multiple logical nodes, and each logical node is bound to a measurement point ID and corresponding specific UI component information for visualization. The logical hierarchy formed by these logical nodes and the UI component information of the page view constitute the view configuration content. It should be noted that the UI component information includes information about the skeleton object to be bound to enable data retrieval.
[0050] In one embodiment, during the process of deduplicating multiple measurement point IDs to obtain multiple distinct target measurement point IDs, each measurement point ID can be traversed. During the traversal, if the traversed measurement point ID does not have the same measurement point ID in the preset physical index set, the measurement point ID is added to the physical index set. Upon completion of the measurement point ID traversal, the measurement point ID in the physical index set is determined as the target measurement point ID.
[0051] For example, suppose on the overall view page, a substation is a test point with a test point ID of 101. On the substation view, a contact under a certain device also has a test point ID of 101. When traversing multiple test point IDs, the traversal will first reach the substation as a test point. Then, "Substation-ID 101" will be added to the physical index set as the target test point ID. Then, the remaining test point IDs will be traversed. When the traversal reaches the test point ID of the contact, which is also 101, the test point ID of the contact will not be added to the physical index set because it conflicts with ID 101 in the physical index set.
[0052] By deduplicating the measurement point IDs, the UI components corresponding to the measurement point IDs can be reused in different views of the monitoring system application. This avoids inconsistencies in data across multiple views due to duplicate measurement point IDs. Furthermore, when the configuration needs to be changed, the mapping relationship of UI components across multiple views can be updated simply by maintaining the same view configuration content, thus effectively improving the convenience of maintenance.
[0053] In one embodiment, the measurement point IDs that are not in the physical index set in the multi-view configuration information are deduplicated to ensure that all measurement point IDs in the multi-view configuration information are different from each other. The remaining measurement point IDs are then deduplicated again. This helps users to perform automated measurement point ID deduplication correction, thereby enabling the configuration of all measurement point data. In turn, it can avoid the loss of multi-view data while maintaining the consistency of multi-view data, and ensure the integrity of multi-view data display.
[0054] See Figure 5 , Figure 5 The flowchart of a method for monitoring page display according to yet another embodiment of this application is shown. In one embodiment, the method for monitoring page display may further include the following steps.
[0055] Step 510: In response to the preset duration already displayed on the current monitoring page, industrial data is retrieved based on the skeleton objects corresponding to each UI component on the monitoring page; Step 520: Re-render the current monitoring page based on the currently retrieved industrial data.
[0056] In one embodiment, the preset duration displayed on the current monitoring page can be determined by the actual duration threshold or indirectly by the preset refresh frequency. For example, if the refresh frequency is 20Hz, then the preset duration is 0.05 seconds, etc. The specific duration is not limited here.
[0057] In one embodiment, retrieving industrial data based on the skeleton objects corresponding to each UI component on the monitoring page refers to determining the UI components used on the current monitoring page and obtaining the real-time data fed back by the corresponding sensors based on the skeleton objects bound to these UI components. It is important to note that skeleton objects corresponding to UI components on pages other than the current monitoring page will not retrieve industrial data; that is, industrial data retrieval is localized. More importantly, the real-time data fed back by the sensors is not directly transmitted to the skeleton objects but is stored in a memory repository awaiting retrieval by the specific skeleton object.
[0058] By updating only the industrial data displayed on the current monitoring page, the monitoring system application does not need to fetch all the industrial data that can be mapped by the skeleton object in the background. This allows the data update display on the monitoring page to be proactive, thereby shielding the jitter and high concurrency caused by the passive reporting of underlying hardware data. In this way, no matter how many times the underlying data changes per second, the monitoring page can always refresh stably based on a preset time interval, effectively reducing the lag when using the monitoring page.
[0059] Based on the above embodiments, some specific embodiments are given below.
[0060] Example 1: Loading all historical data during a cold start of an industrial terminal can lead to slow startup (long black screen time); if no data is loaded, the initial value of 0 or null can easily trigger false alarms for "low temperature / low pressure". Traditional A / B partitioning or full dumping solutions have a negative impact on Flash lifespan and startup speed.
[0061] Based on steps 110 to 140 above, during the initial startup of the system main program (UIAbility) or service, the data manager first reads a lightweight static configuration file (containing a list of physical IDs). The processor traverses this ID list and quickly instantiates skeleton objects for all measurement points in memory. At this time, the objects only contain static attributes (such as pointId), their dynamic monitoring attributes (such as temperature) are set to null, their online status is set to false, and their alarm thresholds are set to factory default values (such as 60℃). This skeleton object can act as a placeholder, ensuring that the system has the ability to receive underlying hardware data immediately after startup, completely eliminating the risk of false alarms caused by startup delays.
[0062] Next, after the skeleton is built, the system calls the file system interface to read the state snapshot file (cw_sensor_data.json) in non-volatile memory. This file records the last state of the device before power failure. The processor uses a "non-destructive merging algorithm" to traverse the snapshot data. For each measurement point, the system only extracts persistent fields from the snapshot (such as user-modified warning values, alarm values, and other static attributes) and injects them into the existing skeleton object in memory. If the data for a measurement point is not present in the snapshot (e.g., when a new device is added), the default settings in the skeleton are retained, without affecting system operation.
[0063] During system operation, whenever a user modifies the configuration (such as adjusting the threshold) or detects a critical state change, the data manager will trigger a file stream write operation to serialize the persistent fields of the current memory object and overwrite the local snapshot, ensuring that the current state can be accurately restored when the system is restarted after a power outage.
[0064] Example 2: In the Stage model of Open Harmony 3.2, UI Ability and background Worker threads have isolated memory contexts. When the UI is in the background or destroyed, background data collection tasks often suffer data loss or interrupted recording because they cannot obtain the sandbox path (filesDir).
[0065] Based on steps 310 to 330, in the `onCreate` lifecycle method of the application's main entry point (`EntryAbility`), the system context capabilities available at this time are utilized to call the system API (`this.context.filesDir`) to obtain the absolute sandbox path of the current application in the file system. Then, the system immediately calls the initialization interface (`initContext`) of the data management module (`CwjsDataManager`) to inject the aforementioned path string and make it reside in the memory space of the singleton object. At this point, the data management module gains the ability to independently access the file system.
[0066] This ensures that the background data acquisition service (Worker) has file read and write capabilities independent of the UI lifecycle, achieving complete decoupling between "business logic" and "UI lifecycle." The singleton object responsible for coordinating data gains persistence capabilities the moment the system starts. Even in extreme cases where the screen is off and the UI is recycled, the underlying communication and data storage services can still operate in a closed loop, ensuring the integrity of industrial terminal data and system reliability.
[0067] Example 3: Traditional configuration software typically uses a hard-coded method of "one-to-one binding between physical IDs and UI components." When the same measurement point needs to appear simultaneously in the "total station map," "interval map," and "early warning list," engineers need to maintain three configurations. Once a sensor is changed, three modifications are required, which easily leads to data conflicts due to omissions in the modifications.
[0068] Based on steps 410 to 440, the system first reads the unstructured, hierarchically nested view configuration file, which describes the logical hierarchy expected by the user, such as: "Substation => Cabinet No. 1 => Contactor A => Measurement Point ID=101" and "Plant Overview => Key Equipment => Measurement Point ID=101". Note that ID=101 appears multiple times in the configuration at this point. Next, the system calls the configuration utility class (PointLayoutConfigUtils) to traverse the above logical tree recursively or through nested loops. Specifically, the processor defines an empty physical index set, traverses each logical node (Location), obtains its bound measurement point ID, and for each measurement point ID read, checks whether it already exists in the physical index set. Only when the ID is a newly appearing valid value is it added to the set, regardless of how many times a measurement point ID appears in the view configuration. The final generated physical index set contains only one unique measurement point ID.
[0069] The data manager (CwjsDataManager) initializes data objects in memory based on the deduplicated set of physical indices mentioned above. This means that the system maintains only one object with ID=101 (a single source of information). When the underlying serial port reports temperature data with ID=101, the system only updates this single memory object. All upper-level view components that reference ID=101 point to the same memory address during rendering, thus naturally ensuring the consistency of multi-view data.
[0070] Example 4: In the typical development model of ArkUI (or Vue / React, etc.) in Open Harmony, UI updates rely on "observation" or "dirty detection". When thousands of sensors report data at a millisecond frequency, it triggers a massive amount of invalid redraw calculations, causing the UI main thread to be overloaded, resulting in UI freezing (Jank) or even program unresponsiveness (ANR).
[0071] Based on steps 510 to 520, The UI component (CwRealtime) internally maintains an independent timer (PagesetInterval) with a fixed refresh interval. Instead of binding to full configuration data (fullConfig), the UI component maintains a slice array (cabinetList) containing only the currently visible screen area. Based on the current page index (PAGE_SIZE), it extracts the configurations of the cabinets that need to be displayed using the startIndexfullConfig.slice(start,end) method. Regardless of the number of measurement points in the background, the rendering engine only needs to process the UI nodes corresponding to these cabinets each frame.
[0072] When the timer is triggered (the refresh frequency can be set, such as once every 500ms), a state variable (refreshFlag) is reversed. The ArkUI framework of the current page only needs to focus on the change of the refreshFlag state variable to drive the view refresh of the current page, instead of binding all points to the @state state variable. The text display function (getTemperatureDisplayrefreshFlag) in the UI component detects the change and performs a redraw. The redraw function actively pulls the latest industrial data.
[0073] This "UI-active pull mode" completely eliminates the jitter and high concurrency of underlying hardware data reporting. No matter how many times the underlying data changes per second, the UI always refreshes stably at a specific frequency, achieving a smooth experience with "zero lag".
[0074] In addition to the embodiments described above, one embodiment of this application also provides an electronic device. See also Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Figure 6 As shown, the electronic device includes a memory 1100 and a processor 1200. The number of memories 1100 and processors 1200 can be one or more. Figure 6 Taking a memory 1100 and a processor 1200 as an example; Figure 6 The memory 1100 and processor 1200 can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.
[0075] The memory 1100, as a computer-readable storage medium, can be used to store one or more software programs, computer-executable programs, and modules, such as the program, instructions, or modules corresponding to the monitoring page display method provided in any embodiment of this application. The processor 1200 implements the monitoring page display method provided in any embodiment of this application by executing one or more computer programs, instructions, and modules stored in the memory 1100.
[0076] The memory 1100 may primarily include a program storage area and a data storage area, wherein the program storage area may store the operating system and computer programs required for at least one function. Furthermore, the memory 1100 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 1100 may further include memory remotely located relative to the processor 1200, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0077] In addition to the embodiments described above, one embodiment of this application also provides a computer-readable storage medium storing computer-executable instructions for performing the monitoring page display method as described in any of the preceding embodiments.
[0078] Furthermore, one embodiment of this application also provides a computer program product, including a computer program or computer instructions, which are stored in a computer-readable storage medium. A processor of an electronic device reads the computer program or computer instructions from the computer-readable storage medium and executes the computer program or computer instructions, causing the electronic device to perform the monitoring page display method as described in any of the preceding embodiments.
[0079] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0080] The above is a detailed description of the preferred embodiments of this application. However, this application is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A method for monitoring page display, characterized in that, include: Instantiate the business logic singleton based on its configuration information to obtain the business logic singleton object; Obtain the application file sandbox path configuration information in the monitoring system application; According to the application file sandbox path configuration information, the application file sandbox path is injected into the business logic singleton object to obtain the business logic singleton object configured with the application file sandbox path, wherein the current business logic singleton object is used for skeleton object instantiation; In response to the startup of the monitoring system application and the creation lifecycle of entering the main program entry of the monitoring system application, the static configuration information of the monitoring system application is instantiated to obtain a skeleton object of multiple industrial data measurement points, wherein the skeleton object is a data framework containing multiple monitoring attributes of a measurement point; Get status snapshot data; For each skeleton object, the skeleton object is compared with the state snapshot data. In response to the skeleton object not matching the state snapshot data, the target persistent field corresponding to the skeleton object in the state snapshot data is determined, and the skeleton object is updated according to the determined target persistent field. The monitoring page is displayed based on the current multiple skeleton objects.
2. The method according to claim 1, characterized in that, The method further includes: In response to changes to the skeleton object in the monitoring page that are not real-time data, the changed content is written to the skeleton object; The current state snapshot data is overwritten and updated based on the current skeleton object.
3. The method according to claim 1, characterized in that, The method further includes: In response to the skeleton object not having a corresponding content in the state snapshot data, the skeleton object is maintained.
4. The method according to claim 1, characterized in that, The method further includes: In response to the monitoring system application detecting a power supply anomaly, a state snapshot of the current multiple skeleton objects is performed through the business logic singleton object.
5. The method according to claim 1, characterized in that, The monitoring page display based on the current multiple skeleton objects includes: Obtain the multi-view configuration information of the monitoring system application, wherein the multi-view configuration information includes view configuration content of multiple industrial data measurement points, and the view configuration content includes measurement point ID; The multiple measurement point IDs are deduplicated and traversed to obtain multiple distinct target measurement point IDs; The UI component is instantiated based on the view configuration content corresponding to the multiple target measurement point IDs, wherein the UI component is bound to one or more of the current multiple skeleton objects; The monitoring page is displayed based on the UI components and the corresponding bound skeleton objects.
6. The method according to claim 5, characterized in that, The process of deduplicating multiple measurement point IDs to obtain multiple distinct target measurement point IDs includes: Each of the measured point IDs is traversed, and during the traversal, if the measured point IDs encountered do not have the same measured point IDs in the preset physical index set, the measured point IDs are added to the physical index set. In response to the completion of the traversal of the measurement point IDs, the measurement point ID in the physical index set is determined as the target measurement point ID.
7. The method according to claim 5, characterized in that, The method further includes: In response to the fact that the current monitoring page has displayed a preset duration, industrial data is retrieved based on the skeleton object corresponding to each UI component on the monitoring page; The monitoring page is re-rendered based on the currently retrieved industrial data.
8. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; The monitoring page display method as described in any one of claims 1 to 7 is implemented when at least one of the programs is executed by at least one of the processors.
9. A computer-readable storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the monitoring page display method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Label page recovery method and device, equipment and storage medium
CN121256162A
