Card dynamic layout display method and system, electronic device and computer storage medium
Patent Information
- Application Number
- CN202611542943.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-08
- Publication Date
- 2026-11-03
AI Technical Summary
Existing human-computer interaction interfaces are complex to operate and poorly adapted to user needs, causing users to repeatedly switch pages, increasing hardware resource consumption and communication traffic consumption. Furthermore, they are prone to losing local states and repeated initialization when port states change.
By obtaining the port context of the target port, reading the capability description of the candidate cards, generating a set of legal cards, generating a pagination layout based on card priority, scheduling data collection tasks, displaying data information in real time, and building a feedback linkage mechanism.
It simplifies the operation process, reduces the overhead of repeated data collection and rearrangement, improves the adaptability of the interface to requirements, and reduces hardware resource consumption and communication traffic.
Smart Images

Figure CN123030103A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of interface display, in particular to a card dynamic layout display method and system, an electronic device and a computer storage medium. BACKGROUND
[0002] A graphical user interface (GUI) is a format of interface display for human-computer communication. On one hand, it displays relevant information to users in a visual manner through cards (including menus and function components, etc.) arranged on the interface. On the other hand, it allows users to manipulate cards on the screen using a mouse or other input devices to select commands, call files, start programs or perform other daily tasks.
[0003] The existing human-computer interaction interface usually uses pre-fixed menus, tabs and pages to realize relevant functions, and each page mainly displays data corresponding to a function. When the data of a certain business involves multiple functions, multiple pages are often needed to display the data corresponding to the respective functions, so that the user needs to repeatedly switch pages when checking, increasing the operation complexity.
[0004] Moreover, the existing human-computer interaction interface usually judges the board card type, business type or port rate, etc. in each menu or function component, and hides the functions that are not applicable accordingly. This way can filter individual functions, but it is difficult to uniformly handle the pre-requisites between functions, test safety conditions and user display preferences, etc. When the port configuration changes or the user settings conflict with the capability conditions, the interface may be left with inapplicable functions or may hide the pre-requisites required for test running, resulting in poor adaptability of the actual display of the interface to the requirements.
[0005] In addition, in the existing human-computer interaction interface, function components usually start a timer independently after being created and request data according to a fixed period. As long as the function component is not destroyed, it may continue to poll even if it is located in a non-current page or has been hidden by the user, increasing the occupation of hardware resources and the consumption of communication traffic.
[0006] In addition, when the port state changes or the display area is switched, the existing human-computer interaction interface regenerates the entire function area or destroys and recreates the components. This will cause function components that are not affected by the state change to be recalculated and moved, possibly losing local states such as table scroll position, dynamic column, filtering condition, current channel, etc., causing repeated initialization and repeated data requests, and increasing the amount of reconstruction calculation. SUMMARY
[0007] The application aims to provide a card dynamic layout display method and system, an electronic device and a computer storage medium, so as to at least solve the problem of complex operation and poor adaptability of the existing man-machine interface.
[0008] To solve the above technical problems, the application provides a card dynamic layout display method, comprising: obtaining the port context of the target port; reading the capability description of the candidate card and generating a legal card set according to the port context and the hard constraint; generating a pagination layout by using the original layout according to the card priority; scheduling a data acquisition task according to the pagination layout and the card state; displaying the data information acquired by the data acquisition task of each card in the pagination layout in real time.
[0009] Optionally, in the card dynamic layout display method, the port context comprises port basic information, port detailed information, a data path, multiplexing configuration, module state information, alarm performance data and user configuration.
[0010] Optionally, in the card dynamic layout display method, the method for obtaining the port context of the target port comprises: using the port identifier as an index and obtaining the port context of the target port in a preset manner, comprising: when entering the device or the port, reading the port basic information and the user configuration of the target port; querying the port detailed information, the data path, the multiplexing configuration and the module state information of the target port at a preset period; acquiring the alarm performance data of the target port at a common timing, wherein the common timing is determined according to the board type or the performance configuration.
[0011] Optionally, in the card dynamic layout display method, the capability description comprises a card identifier, applicable conditions, prohibited conditions, a dependency relationship and detailed function positioning information.
[0012] Optionally, in the card dynamic layout display method, the method for reading the capability description of the candidate card and generating a legal card set according to the port context and the hard constraint comprises: reading the capability description of the candidate card from a rule file; judging the applicable conditions and the prohibited conditions of the candidate card according to the port context to exclude the candidate card that does not match the capability of the target port; constructing a directed dependency graph according to the dependency relationship of the candidate card and supplementing the candidate card with the dependency relationship into the directed dependency graph; According to the card identifier and the detailed function positioning information of the candidate card, the candidate card corresponding to the special scene is screened and marked as a mandatory reserved card; All the reserved candidate cards are summarized to obtain a legal card set.
[0013] Optionally, in the card dynamic layout display method, before generating the pagination layout, the card dynamic layout display method further includes: Merging user preferences in the legal card set and repairing conflicts.
[0014] Optionally, in the card dynamic layout display method, the method of merging user preferences in the legal card set and repairing conflicts includes: Obtaining explicit and implicit mapping, order list and top setting; Configuring port capability constraints, test safety constraints and card dependency constraints for all cards in the legal card set; According to the explicit and implicit mapping, the order list and the top setting, configuring user explicit and implicit, ordering and top preferences for all cards in the legal card set; Configuring system default order for all cards in the legal card set.
[0015] Optionally, in the card dynamic layout display method, the method of merging user preferences in the legal card set and repairing conflicts further includes: When the user preference conflicts with the port capability, the card does not enter the running layout, but the configuration record is reserved; When the user preference requires to hide the mandatory reserved card or requires to hide the front card relied on by other cards, the card is reserved and the reason why the user preference is not effective is recorded; When the user order in the user preference violates the dependency relationship, the user order is repaired according to the directed dependency graph.
[0016] Optionally, in the card dynamic layout display method, the method of generating the pagination layout according to the card priority and using the original layout includes: Calculating dynamic priority and arranging cards; Paginating according to card size, container width in the original layout and capacity per page to generate a pagination layout.
[0017] Optionally, in the card dynamic layout display method, the method of calculating dynamic priority and arranging cards includes: Calculating dynamic priority; On the premise of meeting the dependency order, the cards are sorted according to the dynamic priority; When a new card is inserted, the dynamic priority difference between the new card and the old card is compared, if the dynamic priority difference does not exceed the transposition threshold, the original position is kept, otherwise the relative order between the new card and the old card is adjusted.
[0018] Optionally, in the card dynamic layout display method, the method for scheduling the data acquisition task according to the paging layout and the card state comprises: scheduling the data acquisition task according to the visible level of the card in the paging layout and the data real-time level; listening to the port context and processing the related cards affected by the change of the port context field to update the legal card set, the card priority and the paging layout.
[0019] Optionally, in the card dynamic layout display method, the method for scheduling the data acquisition task according to the paging layout and the card state further comprises: when multiple cards request the same data object of the same port, a shared task key is constructed according to the port identifier, the data object, the channel range and the parameter digest, and the cards with the same shared task key reuse the same in-transit request or cache result.
[0020] Optionally, in the card dynamic layout display method, the card dynamic layout display method further comprises: entering the corresponding detailed function page according to the detailed function positioning information saved in the card; redistributing the display space when the card area is expanded or contracted, and keeping the port overview view; when the window size, the top area height or the card area state changes, the card area height and the port overview view height are recalculated; if the calculated port overview view height is lower than a preset height threshold, the port overview view is switched to a scroll layout or the port overview view is hidden.
[0021] To solve the above technical problems, the application further provides a card dynamic layout display system for implementing the card dynamic layout display method as claimed in any one of the above, the card dynamic layout display system comprising: a context acquisition module for acquiring the port context of a target port; a legal card generation module for reading the capability description of a candidate card and generating a legal card set according to the port context and the hard constraint; a paging layout generation module for generating a paging layout according to the card priority and using the original layout; an acquisition scheduling module for scheduling a data acquisition task according to the paging layout and the card state; The page display module is configured to display data information acquired by each card corresponding data acquisition task in real time in the pagination layout.
[0022] Optionally, in the card dynamic layout display system, the card dynamic layout display system further comprises: The page positioning module is configured to enter a corresponding detailed function page according to detailed function positioning information stored in the card. The partition display module is configured to re-allocate display space when the card area is expanded or contracted and keep the port overview view; and re-calculate the card area height and the port overview view height when the window size, the top area height or the card area state changes; and switch the port overview view to a scroll layout or hide the port overview view if the calculated port overview view height is lower than a preset height threshold.
[0023] To solve the above technical problems, the application further provides an electronic device comprising a memory, a processor and an executable program stored in the memory and capable of being executed by the processor; the processor executes the executable program to perform the card dynamic layout display method according to any one of the above.
[0024] To solve the above technical problems, the application further provides a computer storage medium storing an executable program; the executable program is executed to implement the card dynamic layout display method according to any one of the above.
[0025] The card dynamic layout display method and system, the electronic device and the computer storage medium provided by the application comprise: acquiring a port context of a target port; reading a capability description of a candidate card and generating a legal card set according to the port context and a hard constraint; generating a pagination layout by using an original layout according to a card priority; scheduling a data acquisition task according to the pagination layout and a card state; and displaying data information acquired by each card corresponding data acquisition task in real time in the pagination layout. By generating a legal card set according to a port context and a card capability description, generating a pagination layout according to a card priority, and scheduling a data acquisition task according to a card state, a feedback linkage mechanism is constructed, which not only makes the interface presentation result adapt to the port capability, the real-time state and the user focus item, but also makes the layout result control the data acquisition task reversely, thereby reducing the overhead caused by full re-arrangement and repeated acquisition while adapting to the user demand and simplifying the operation, and solving the problem that the existing man-machine interaction interface operation is complex and poorly adapted to the demand. BRIEF DESCRIPTION OF DRAWINGS
[0026] Figure 1 A flowchart of the card dynamic layout display method provided by the embodiment; Figure 2Fig. 1 shows an interface layout diagram of the card area in the expanded and contracted states according to the embodiment; Figure 3 Fig. 2 shows a structural block diagram of the card dynamic layout display system according to the embodiment. DETAILED DESCRIPTION
[0027] The card dynamic layout display method and system, electronic device and computer storage medium according to the embodiment of the present application will be further described in detail below in combination with the accompanying drawings and specific embodiments. It should be noted that the accompanying drawings are all in a very simplified form and all use non-precise proportions, only to facilitate and clearly assist the purpose of describing the embodiments of the present application. In addition, the structure shown in the drawings is often a part of the actual structure. In particular, the emphasis of each drawing needs to be different, sometimes different proportions are used.
[0028] It should be noted that the "first", "second" and the like in the specification and claims of the present application and the drawings are used to distinguish similar objects in order to describe the embodiments of the present application, and are not used to describe a specific order or sequence. It should be understood that the structures used in this way can be interchanged under appropriate circumstances. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] The embodiment provides a card dynamic layout display method, as shown in Figure 1 The method comprises the following steps of: S1, obtaining a port context of a target port; S2, reading a capability description of a candidate card, and generating a legal card set according to the port context and a hard constraint; S3, generating a pagination layout by using an original layout according to a card priority; S4, scheduling a data acquisition task according to the pagination layout and a card state; S5, displaying data information acquired by each card corresponding to the data acquisition task in the pagination layout in real time.
[0030] The card dynamic layout display method provided by the embodiment generates a legal card set according to the port context and card capability description, generates a paging layout according to the card priority, and schedules a data collection task according to the card state, thereby constructing a feedback linkage mechanism. The interface presentation result can not only adapt to the port capability, real-time state and user focus items, but also make the layout result control the data collection task reversely, thereby reducing the overhead caused by full rearrangement and repeated collection while adapting to user demand and simplifying operation, and solving the problems of complex operation and poor adaptability to demand of the existing man-machine interface.
[0031] Specifically, in the embodiment, in step S1, the port context of the target port is acquired.
[0032] The port context is a structured data set used to describe the current capability, configuration and running state of the target test port. In the embodiment, the port context can specifically include port basic information, port detailed information, data path, multiplexing configuration, module state information, alarm performance data and user configuration, etc.
[0033] In actual application, for the port basic information such as port name, slot, port number, card type, etc., the port basic information can be read when entering the device or port, and the update is triggered when the port list is updated; the port basic information is usually from the saved device port list.
[0034] In addition, for the port detailed information such as service type, rate, service path, FEC (forward error correction) mode, channel, BULK PRBS load state, etc., the port detailed information can be queried at a preset period, and the update is triggered when the configuration is submitted, the test is started or stopped; the port detailed information is usually from the port detailed state interface.
[0035] In addition, for the data path and multiplexing configuration, the data path such as OTN (optical transport network), FlexO (optical transport network interface), OTUCn (flexible rate frame structure of OTN) level, etc. can be queried at a preset period, and the update is triggered when the service path or global multiplexing configuration changes; the data path is usually from the data path interface, and the multiplexing configuration is usually from the global configuration structure.
[0036] and, for the module status information, taking the optical module as an example, including the optical module status and capability, and the optical module control status, wherein the optical module status and capability includes the bit, temperature, management interface, type, vendor, module capability, etc., and the optical module control status includes the laser, reset, low power consumption, etc. The module status information can be queried at a preset period, wherein the optical module status and capability can also be triggered to update after the module is plugged or the status changes; the optical module control status can also be checked after the operation and triggered to update after the control operation is completed. The optical module status and capability usually come from the optical module status interface and the optical module information interface, and the optical module control status usually comes from the optical module input and output control interface.
[0037] and, for the alarm performance data, such as the PHY (physical layer), PCS (physical coding sublayer), MAC (media access control), OTN, FlexO, mapping layer, PRBS (pseudo random code) alarm, and the bit error rate, FEC and utilization, etc., can be collected at a public timing, and triggered to update when the period arrives, the page is cut or the manual refresh is performed; the alarm performance data usually comes from the device interface called by the port overview data collection logic.
[0038] and, for the user configuration, including the user status such as the card display, arrangement order and current card page, etc., can be read when entering the port, and triggered to update after the user adjusts the layout and saves; the user status usually comes from the browser session, the device local database or the user account configuration.
[0039] In addition, in actual application, the port context can also include the traffic and special test, and the detailed page position.
[0040] For the traffic and special test, such as the traffic, service interruption, RFC2544 (network interconnection device performance benchmark test standard) configuration, running state and result, etc., can be collected at a channel period, and triggered to update when the test is started or stopped, the page is cut or the period arrives; the traffic and special test usually comes from the corresponding function interface.
[0041] and, for the detailed page position, such as the protocol layer, sub-function and channel position, etc., can be written before jumping, and triggered to update when the user selects the card or the abnormal channel; the detailed page position usually comes from the front-end shared tab state.
[0042] In the embodiment, the preset period can be 2s; the public timing can be determined according to the board type or performance configuration, for example, it can be 1s or 2s. And in the embodiment, when the component is unloaded or disabled, the corresponding timing task is stopped to stop the acquisition of the corresponding port context.
[0043] In a specific embodiment, after a configuration change, test start-stop and user page switching, a related port context collection can be triggered immediately, and subsequent periodical query can be used for subsequent state checking. In addition, alarm performance data can also be updated by event triggering, and supplemented by low-frequency periodical checking, so as to further reduce the consumption of collection resources.
[0044] Preferably, in actual application, the version number, update time and validity period and the like information can also be recorded, so as to realize version management.
[0045] Further, in the embodiment, in step S2, the capability description of the candidate card is read, and a legal card set is generated according to the port context and the hard constraint.
[0046] The capability description is used to define the applicable condition, the prohibited condition, the dependency relationship, the data source, the real-time level, the refresh cost and the machine-determinable rule of the detailed function position of the candidate card. Specifically, in the embodiment, the capability description of the card includes the card identification, the applicable condition, the prohibited condition, the dependency relationship, the detailed function positioning information, the display component, the data object, the real-time level, the refresh period, the refresh cost, the basic priority and the like.
[0047] In addition, the hard constraint refers to a constraint that cannot be covered by the user preference, including the port capability constraint, the test safety constraint and the card dependency constraint. Correspondingly, the soft constraint refers to a setting that can be applied or repaired without violating the hard constraint, including the user explicit or implicit preference, the order preference and the top preference.
[0048] In actual application, the method of reading the capability description of the candidate card and generating the legal card set according to the port context and the hard constraint includes: S21, reading the capability description of the candidate card from a rule file. The rule file can be saved in a front-end configuration file, a back-end database or issued by the back-end according to the device model and software version.
[0049] Preferably, the read capability description can further form a rule set, and the rule set can be versioned, and the rule set can be further added with preposition dependency, forced display condition, maximum allowed collection interval, refresh cost and dependent port state item and the like.
[0050] In actual application, the capability description can be written as a limited expression or a structured condition tree. When the expression is used, the accessible field and the operator should be limited to avoid direct execution of any script.
[0051] S22, judging the applicable condition and the prohibited condition of the candidate card according to the port context, so as to exclude the candidate card that does not match the target port capability.
[0052] For the candidate cards with port capability mismatch, no display component is created and no data collection task is started, but the card configuration saved by the user in the past can still be retained. When the user enters the layout editing mode, the card and the reason for its unavailability can be displayed by a grayed-out placeholder; when the port capability is restored, the original user preference can be applied and subsequent layout work can be continued.
[0053] S23, a directed dependency graph is constructed according to the dependency relationship of the candidate cards, and the candidate cards with existing dependency relationship are filled in according to the directed dependency graph. Among them, the necessary pre-requisite cards can be filled in from the retained cards along the dependency relationship.
[0054] Preferably, the circular dependency can also be detected, that is, when a cycle is found in the directed dependency graph, the related cards are stopped from being loaded, and a rule error is recorded.
[0055] S24, according to the card identifier and detailed function positioning information of the candidate card, the candidate card corresponding to the special scene is screened and marked as a mandatory retention card. Specifically, the test control card, the running state card and the safety prompt card can be set as mandatory retention cards under certain conditions. For example, when the test is running or there is a high-level alarm, the related running state and safety prompt cannot be hidden by user preference, so the running state card and the safety prompt card are set as mandatory retention cards.
[0056] Corresponding to the actual application requirement, the embodiment gives a setting rule of the mandatory retention card, as follows: When the test is running, the test control card and the current business test state card are set as mandatory retention cards; When there is a high-level FEC alarm, the current business test state card and the FEC state card are set as mandatory retention cards; When the service is interrupted or RFC2544 is running, the corresponding special test state card and the test control card are set as mandatory retention cards; When the port permission or occupation is abnormal, the safety prompt card and the port state card are set as mandatory retention cards; When the optical module is offline or the management interface is abnormal, the optical module state card is set as a mandatory retention card.
[0057] Of course, in other embodiments, those skilled in the art can reasonably set the rules of the mandatory retention card according to the actual requirement, and the present application does not limit this.
[0058] S25, all the retained candidate cards are summarized to obtain a legal card set.
[0059] Further, in the embodiment, step S3, a paginated layout is generated according to the card priority using the original layout.
[0060] Preferably, in the embodiment, before generating the paging layout in step S3, the card dynamic layout display method further comprises: merging user preferences in the legal card set and repairing conflicts.
[0061] Specifically, in the embodiment, first, the explicit and implicit mapping, the order list and the top setting saved with user identification, device identification and port identification as index are obtained; then, the port capability constraint, the test safety constraint and the card dependency constraint are configured for all cards in the legal card set; then, the user explicit and implicit, the order and the top preference are configured for all cards in the legal card set according to the explicit and implicit mapping, the order list and the top setting; finally, the system default order is configured for all cards in the legal card set.
[0062] In addition, in the embodiment, when the user preference conflicts with the port capability, the card does not enter the running layout, but the configuration record is reserved; when the user preference requires to hide the card or requires to hide the front card which is depended by other cards, the card is reserved and the reason why the user preference is not effective is recorded; when the user order in the user preference violates the dependency relationship, the user order is repaired according to the directed dependency graph; the new card which does not exist in the historical configuration is inserted according to the default priority, so as to avoid being omitted by the old configuration.
[0063] Specifically, in the embodiment, the method for generating the paging layout according to the card priority comprises: S31, calculating the dynamic priority and arranging the cards.
[0064] In actual application, first, the dynamic priority is calculated. Specifically, weighted calculation, hierarchical decision table or other sorting methods which can reflect the test stage, alarm level, user attention and refresh cost can be used to determine the dynamic priority. This embodiment gives a calculation method of the dynamic priority as follows:
[0065] Wherein, P represents the dynamic priority of the card, B represents the basic priority of the card, S represents the test stage related degree of the card, A represents the alarm level of the card, U represents the user attention of the card, C represents the refresh cost of the card, 、 、 and are the corresponding weights. In actual application, the weights can be given by the configuration table or the scheduling strategy.
[0066] Then, the cards are sorted according to the dynamic priority under the premise of meeting the dependency order.
[0067] When a new card is inserted, the dynamic priority difference between the new card and the old card is compared. If the dynamic priority difference does not exceed the position switching threshold, the original position is maintained, otherwise the relative order between the new card and the old card is adjusted. In this way, frequent position switching caused by slight state changes can be avoided, which not only reduces the relevant calculation overhead, but also improves the stability of the layout display.
[0068] In S32, the cards are paginated according to the card size, the container width in the original layout and the capacity per page to generate a paginated layout.
[0069] In actual applications, for a multi-channel port, the same type of data can be aggregated into a card, and an abnormal channel can be marked in the card, thereby avoiding repeated card creation and repeated collection tasks for each channel.
[0070] In a specific embodiment, in order to ensure the display effect of the cards in the pagination, the maximum number of cards placed per page, the minimum interval between the cards and the minimum width of each card are defined. If the number of cards does not reach the maximum number of cards under the current pagination layout, the interval between the cards and the width of a single card in the pagination layout after the number of cards is increased are calculated. If the card interval is less than the predefined minimum interval, or the width of a single card is less than the predefined minimum width, the current pagination layout can be adjusted (the number of single-row cards is reduced), or pagination is increased to place the newly added cards.
[0071] Further, in this embodiment, in step S4, the data collection task is scheduled according to the pagination layout and the card state.
[0072] Specifically, in this embodiment, the data collection task is scheduled according to the visible level of the card in the pagination layout and the real-time level of the data. The visible level refers to the state of the card in the current port view, including the current page visible, the non-current page, the user hidden, the capability excluded and the edit mode grayed out. The collection task description is used to record the structured data of the card data interface, the normal period, the minimum period, the real-time level, the task state, the cancellation handle and the shared task key.
[0073] In actual applications, a collection task description can be established for each card, and the scheduling scheme of different tasks is determined according to the visible level of the card. This embodiment gives a corresponding relationship between the visible level of a card and the scheduling scheme as follows: For the card with the visible level of the current page visible, the normal period is collected for the ordinary data task and the alarm or test state task. For the card with the visible level of the non-current page (still in the layout), the ordinary data task is collected at a reduced frequency or suspended; the alarm or test state task is collected at a frequency not lower than the minimum frequency. For the card with the visibility level of user hidden, for the normal data task, the collection is suspended and the unfinished request is cancelled; for the alarm or test status task, the minimum frequency collection or the collection is suspended according to the safety policy; For the card with the visibility level of capability excluded (excluded by the port capability), for the normal data task and the alarm or test status task, the timer is stopped and the request is cancelled; For the card with the visibility level of edit mode greyed out, for the normal data task and the alarm or test status task, the collection task is not created.
[0074] In practical application, for the collection task of the data type of high-level alarm, test start-stop and zero-clearing status, the normal period of the current page is 1-2s, which can be determined according to the card configuration; the maximum allowed collection interval of the non-current page is 5s; the test running period in the hidden state is 5s; For the collection task of the data type of FEC and error code digest, transceiver utilization rate and service flow status, the normal period of the current page is 2s; the maximum allowed collection interval of the non-current page is 5-10s; the collection is suspended in the hidden state; For the collection task of the data type of PHY, PCS, MAC and OTN hierarchical status, the normal period of the current page is 2s; the maximum allowed collection interval of the non-current page is 5s; the collection is suspended or retained according to the safety policy in the hidden state; For the collection task of the data type of service interruption test status and RFC2544 running status, the normal period of the current page is 1s in the test and 5s in the idle state; the maximum allowed collection interval of the non-current page is 5s; the test running is retained in the hidden state; For the collection task of the data type of port static configuration, the normal period of the current page is immediately acquired when entering the page and verified after 2-5s; the maximum allowed collection interval of the non-current page is 10s; the collection is suspended when the port capability does not change in the hidden state; For the collection task of the data type of optical module in place and management status, the normal period of the current page is 2s; the maximum allowed collection interval of the non-current page is 5s; the collection is 10s or suspended in the hidden state; For the collection task of the data type of optical power and temperature, the normal period of the current page is 2s; the maximum allowed collection interval of the non-current page is 10s; the collection is suspended in the hidden state.
[0075] The maximum allowed collection interval refers to the longest time allowed between adjacent two collections of the collection task in the reduced frequency state.
[0076] Of course, in other embodiments, the skilled in the art can reasonably set the scheduling mode of various data collection tasks according to the actual needs, for example, the timing polling, the server push, the device event subscription or the combination of multiple modes, which are not limited in the application.
[0077] In a specific embodiment, when the card is switched from a non-current page to a current page, a collection can be performed immediately once, and then the normal period is resumed; when the task is paused or cancelled, the last valid result and its timestamp are saved; after the task is resumed, if the cache is still within the valid period, the cache can be displayed first, and then the latest data is asynchronously obtained.
[0078] It should be noted that the scheduling of the data collection task is not a linear page step performed only once, but a background scheduling process started after the first layout is generated and continuously running during the port session. This process runs in parallel with the port state monitoring and receives the layout results and incremental update results.
[0079] Preferably, in order to avoid repeated access to the device interface, improve the execution efficiency of the data collection task, and reduce the data volume, in the embodiment, when multiple cards request the same data object of the same port, a shared task key is constructed according to the port identifier, data object, channel range and parameter summary, and cards with the same shared task key reuse the same in-transit request or cache result, wherein the shared task key can be generated by string concatenation, hashing or structured key value.
[0080] In addition, in the embodiment, step S4 further comprises: monitoring the port context, and processing related cards affected by changes in the port context field to update the set of legal cards, card priority and pagination layout.
[0081] Specifically, in actual application, by comparing the new and old port context, the set of changed fields is obtained, and then the directly affected cards are determined through the reverse index of “context field-card identifier”; the preposition and subsequent dependent cards of these cards are added to the affected set, and only the generated set of legal cards, user preference merging and conflict repair, card priority calculation and arrangement, and data collection task scheduling are re-executed for the obtained dependent subgraph. In this way, when the port state changes, only the related content is recalculated incrementally, thereby effectively reducing the calculation amount.
[0082] For example, when the service type changes from OTN to Ethernet, the test status, FEC, traffic and service interruption cards related to the service type need to be re-matched; if the optical module capability does not change, the optical module basic information card remains in the original position and collection state, and the component is not recreated.
[0083] Further, in the embodiment, step S5, the data information obtained by the data collection task corresponding to each card is displayed in real time in the pagination layout.
[0084] The layout result directly controls the collection task, and the card without relying on the change field does not need to be re-matched, moved or created, which not only makes the interface present result adapt to the port capacity, real-time state and user focus items, but also makes the layout result reversely control the data collection task, thereby reducing the overhead brought by full rearrangement and repeated collection while adapting to user needs and simplifying operation, and solving the problems of complex operation and poor adaptability to needs of the existing man-machine interface.
[0085] Further, in the embodiment, the card dynamic layout display method further comprises: S6, entering the corresponding detailed function page according to the detailed function positioning information saved in the card.
[0086] Specifically, each card saves target routing, protocol layer, sub-function and channel selection information. When the user clicks on the card or the abnormal channel therein, the target level, sub-function and channel are first written into the shared page state, and then the corresponding detailed function page is opened. After the detailed function page reads the shared page state, the function position generating the summary or the abnormality is directly displayed, instead of only entering the page homepage.
[0087] S7, re-allocating display space when the card area is expanded or contracted, and retaining the port overview view.
[0088] Specifically, the data and view state of the port overview table are included in the port context and the overview view snapshot when the port context is obtained. The view state can be saved in the memory, session storage, local database or server user configuration. The card area has an expanded state and a contracted state. Assuming that the available height of the page container is H, the height of the top fixed area is Ht, the height of the card area in the contracted state is Hc, and the area spacing is G, then: In the expanded state of the card area, the height of the card area is H-Ht, and the port overview view is hidden; In the contracted state of the card area, the height of the card area is Hc, and the height of the port overview view is H-Ht-Hc-G; When the window size, the height of the top area or the state of the card area changes, the height of the card area and the height of the port overview view are recalculated; If the calculated height of the port overview view is lower than the preset height threshold, the port overview view is switched to a scroll layout or the port overview view is hidden.
[0089] In practical applications, the port overview view only switches display states and does not destroy component instances. Overview view snapshots are saved by port identifier. These snapshots can include the current protocol layer, sub-functions, table data, scroll position, dynamic columns, filter conditions, current channel, chart display mode, vertical and horizontal scroll position, current card page, card area expand or collapse status, and last update time. Upon redisplay, the overview view snapshot is restored first, and then an update request is initiated based on the data validity period.
[0090] Furthermore, in practical applications, the visibility and order of cards can be saved in the browser session, and the port overview view can be preserved by hiding them without destroying them. Therefore, the overview view snapshot can be retained while the component is not actually unloaded; it can be restored as needed after re-entering across pages.
[0091] In one specific embodiment, such as Figure 2 As shown, in this page layout, each page contains 4 cards (card A, card B, card C, and card D). When the card area is collapsed, the 4 cards become smaller, and a port overview view of the selected card is displayed at the bottom of the page. When the card area is expanded, the 4 cards become larger, and the port overview view is hidden.
[0092] The card dynamic layout display method provided in this embodiment abstracts data objects into cards with unified capability descriptions and arranges them in the same port view. This allows summary information to no longer be limited by the original page hierarchy, and multiple source states can be presented and associated simultaneously. By using applicable conditions, prohibition conditions, dependencies, and security conditions to uniformly solve for the legal card set, it can simultaneously avoid displaying inapplicable functions and hiding necessary prerequisite states. By mapping the card visibility level to the normal, reduced frequency, paused, or canceled state of the acquisition task, the layout result directly controls the acquisition task, reducing invalid interface accesses from the request source. By using shared task keys to reuse in-transit requests or cached results, the same port and data object only need to execute an equivalent request once. By establishing a reverse index from the context field to the card after the port state changes and only recalculating the dependency subgraph, cards without dependent changed fields do not need to be rematched, moved, or created, effectively reducing the amount of computation. By saving routing, protocol layer, sub-function, and channel positioning information, the detailed function position corresponding to abnormal data can be directly restored when switching pages. By only switching the visible state when switching display areas and saving view snapshots by port, it is not necessary to rebuild the table and its local state when restoring the display.
[0093] The following describes the implementation process of the card dynamic layout display method provided in this application using a specific embodiment.
[0094] In the embodiment, the port has four channels supporting OTN, Ethernet and BULK PRBS test. The current service type is OTN, the service data carries BULK PRBS load, the test is in running state, and a high-level FEC alarm occurs in the second channel of the port.
[0095] Firstly, the Ethernet test status card is excluded according to the port context; since the current service carries BULK PRBS load, the service flow card unsuitable for the load mode is also excluded; the FEC status card depends on the OTN test status card, so even if the user has hidden the OTN test status card in advance, the card is still retained according to the dependency constraint, and the preference repair reason is recorded.
[0096] Subsequently, the dynamic priority of the legal card is calculated. The alarm card and the FEC status card increase the priority due to the high-level alarm in the second channel; the status card related to the test running obtains the test phase weight; the card topped by the user and not violating the hard constraint retains the attention weight. According to the calculated dynamic priority, only the card meeting the transposition condition is moved. The FEC status card aggregates the data of the four channels and highlights the second channel.
[0097] After the layout is generated, the background acquisition scheduling process acquires the alarm, FEC and test status data of the current page at a normal period; the normal data of the non-current page is reduced in frequency or suspended; the service flow card excluded by the capability rule does not create a timing task. If the integrated alarm card and the FEC card request the same FEC alarm summary, the two cards share the same in-transit request or cache result through a shared task key.
[0098] When the user switches the service type to Ethernet and closes the BULK PRBS load, the test status, FEC, service flow, service interruption and test control cards and the like need to be reprocessed through reverse indexing of the context field. Further, the OTN test status card is removed, the Ethernet test status card is added, and the service flow card is restored; the card of the optical module state and the like not depending on the change field remains in the original position and the acquisition state.
[0099] In this way, by using the card dynamic layout display method provided in the embodiment, the function matching accuracy is improved, invalid data acquisition and repeated requests are reduced, the calculation and redrawing range when the state changes are reduced, and the view recovery overhead is reduced.
[0100] The embodiment also provides a card dynamic layout display system for implementing the card dynamic layout display method as described above, as shown in Figure 3 The card dynamic layout display system comprises: A context acquisition module is configured to acquire the port context of a target port. a legal card generation module configured to read the capability description of the candidate card and generate a legal card set according to the port context and the hard constraint; a pagination layout generation module configured to generate a pagination layout according to the card priority and the original layout; a collection scheduling module configured to schedule a data collection task according to the pagination layout and the card state; a page display module configured to display the data information acquired by the data collection task corresponding to each card in the pagination layout in real time.
[0101] Further, in the embodiment, as shown in Figure 3 the card dynamic layout display system further includes: a page positioning module configured to enter a corresponding detailed function page according to the detailed function positioning information saved in the card; a partition display module configured to re-allocate the display space when the card area is expanded or shrunk and keep the port overview view; and re-calculate the card area height and the port overview view height when the window size, the top area height or the card area state changes; and if the calculated port overview view height is lower than a preset height threshold, switch the port overview view to a scroll layout or hide the port overview view.
[0102] The card dynamic layout display method and system provided in the embodiment can exclude the cards not supported by the port through unified capability description and hard constraint solving, fill in the necessary dependencies, and improve the function matching accuracy; can effectively reduce invalid data collection by making the ordinary cards that are not in the current page, hidden or excluded by the capability no longer maintain the same collection intensity as the current page; can reduce repeated requests by sharing the task key so that multiple cards can reuse the same in-transit request or cache result; can reduce the calculation and redrawing range when the state changes by making the incremental recalculation only process the affected card subgraph, and keeping the irrelevant cards in the original position and collection state; can shorten the abnormal positioning path by increasing the priority of the related cards when a high-level alarm occurs, and making the user directly enter the corresponding protocol layer, sub-function and channel using the detailed positioning information; can reduce the view recovery overhead by not destroying the port overview component when switching the display area, avoiding repeated initialization and keeping the local operation state; and can facilitate the extension of new boards and business types by mainly adding the port field and the capability description when adding a new capability or card, without rewriting the entire page process.
[0103] In the following, the performance of the card dynamic layout display method and system provided in the present application is analyzed and described by an example. In the example, there are 8 legal cards for one port, 4 legal cards for each page layout, and the public timing collection period is configured as 2 seconds.
[0104] Under the traditional mode, 8 legal cards need to be collected according to the public timing, that is, 8x(60 / 2)=240 times per minute.
[0105] The current page 4 cards are collected according to the public timing in the application scheme, that is, 4x(60 / 2)=120 times per minute; the 2 key cards of the non-current page are collected at an interval of 5 seconds (frequency reduction), that is, 2x(60 / 5)=24 times per minute; and the remaining 2 ordinary cards are suspended. The total number of collection times is 144. Compared with the traditional mode, the card level request of the application scheme is reduced by 40%((240-114) / 240).
[0106] If 6 interface requests per 2 seconds are executed in the fixed port context, the request quantity is 6x(60 / 2)=180 times per minute. When the public collection period is 2 seconds, the total request quantity of the traditional scheme at this time is 240+180=420 times per minute; the total request quantity of the application scheme at this time is 144+180=324 times per minute. Compared with the traditional mode, the reduction ratio of the application scheme is (420-324) / 420x100%≈22.9%.
[0107] The fixed port context is still collected at a period of 2 seconds, and when the public collection period is 1 second, the total request quantity of the traditional scheme at this time is 8x(60 / 1)+180=660 times per minute, and the total request quantity of the application scheme at this time is 4x(60 / 1)+2x(60 / 5)+180=444 times per minute. Compared with the traditional mode, the reduction ratio of the application scheme is (660-444) / 660x100%≈32.7%.
[0108] The above calculation uses a stable period running caliber, does not count the additional requests triggered by page initialization, page switching and configuration changes, and does not superimpose the further benefits generated by shared request deduplication; the port basic information is read from the local storage without generating additional requests; and the "total request number" only refers to the sum of the card collection requests and the above-mentioned 6 types of port context requests.
[0109] In addition, if 3 cards request the same data object, under the traditional mode, the collection number is 3 times per cycle. However, the application scheme reuses the same request through the shared task key, so the collection number is 1 time per cycle. Compared with the traditional mode, the application scheme reduces the repeated data object request by 66.7%. The more the number of cards requesting the same data object, the more obvious the performance improvement of the application scheme.
[0110] When the service switching or the single alarm changes, the traditional method needs to recalculate all the 8 cards, while the application only needs to recalculate 3-5 cards related to the service switching or the single alarm change. Compared with the traditional method, the card recalculation number of the application scheme is reduced by 37.5%-50%. The more the number of cards in the system, the more obvious the performance improvement of the application scheme.
[0111] In addition, the detailed view recovery time of the traditional scheme is about 300-1200 ms, while the detailed view recovery time of the application scheme is about 16-80 ms. Compared with the traditional method, the detailed view recovery time of the application scheme is improved by about 75%-95%.
[0112] From the above examples, it can be found that compared with the traditional scheme, the card dynamic layout display method and system provided by the application have significant advantages in the number of requests, the number of recalculation, and the time consumption.
[0113] In addition, the embodiment also provides an electronic device, which includes a memory, a processor, and an executable program stored in the memory and capable of being executed by the processor; when the processor executes the executable program, the card dynamic layout display method described above is executed.
[0114] In addition, the embodiment also provides a computer storage medium, which stores an executable program; when the executable program is executed, the card dynamic layout display method described above is implemented.
[0115] It should be noted that the embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. In addition, the different parts of each embodiment can also be used in combination, and the application does not limit this.
[0116] The card dynamic layout display method and system, the electronic device and the computer storage medium provided by the embodiment comprise: obtaining a port context of a target port; reading a capability description of a candidate card, and generating a legal card set according to the port context and a hard constraint; generating a pagination layout by using an original layout according to a card priority; scheduling a data acquisition task according to the pagination layout and a card state; and displaying data information acquired by each card corresponding to the data acquisition task in the pagination layout in real time. By generating a legal card set according to the port context and the card capability description, generating a pagination layout according to the card priority, and scheduling a data acquisition task according to the card state, a feedback linkage mechanism is constructed, not only can the interface presentation result adapt to the port capability, the real-time state and the user focus item, but also the layout result controls the data acquisition task reversely, so that the user demand is adapted and the operation is simplified, the overhead caused by full-amount rearrangement and repeated acquisition is reduced, and the problem that the existing man-machine interaction interface operation is complex and the adaptability to the demand is poor is solved.
[0117] The above description is only a description of the preferred embodiments of the present application, and does not limit the scope of the present application in any way. Any modification or change made by a person skilled in the art according to the above disclosure is within the protection scope of the claims.
Claims
1. A method for dynamically displaying card layouts, characterized in that, include: Get the port context of the target port; Read the capability descriptions of candidate cards and generate a set of valid cards based on the port context and hard constraints; Generate a pagination layout based on the card priority using the original layout; Schedule data collection tasks based on pagination layout and card status; The paginated layout displays the data information acquired by each data collection task corresponding to each card in real time.
2. The card dynamic layout display method according to claim 1, characterized in that, The port context includes basic port information, detailed port information, data path, reuse configuration, module status information, alarm performance data, and user configuration.
3. The card dynamic layout display method according to claim 2, characterized in that, The method for obtaining the port context of the target port includes: Using the port identifier as an index, retrieve the port context of the target port in a preset manner, including: Upon accessing a device or port, read the target port's basic information and user configuration. At a preset period, query the target port's detailed port information, data path, reuse configuration, and module status information; The alarm performance data of the target port is collected using a common timing mechanism, where the common timing mechanism is determined based on the board type or performance configuration.
4. The card dynamic layout display method according to claim 1, characterized in that, The capability description includes card identifier, applicable conditions, prohibited conditions, dependencies, and detailed functional positioning information.
5. The card dynamic layout display method according to claim 4, characterized in that, The method for describing the ability to read candidate cards and generating a set of legal cards based on port context and hard constraints includes: Read the capability descriptions of the candidate cards from the rules file; Based on the port context, determine the applicable and prohibited conditions of the candidate cards to exclude candidate cards that do not match the capabilities of the target port; Based on the dependencies of the candidate cards, construct a directed dependency graph, and then fill in the candidate cards with dependencies based on the directed dependency graph. Based on the card identifier and detailed functional positioning information of the candidate cards, filter the candidate cards corresponding to special scenarios and mark them as mandatory retention cards; Summarize all retained candidate cards to obtain the set of valid cards.
6. The card dynamic layout display method according to claim 1, characterized in that, Before generating the pagination layout, the dynamic card layout display method further includes: Merge user preferences into the valid card set and resolve conflicts.
7. The card dynamic layout display method according to claim 6, characterized in that, The method for merging user preferences in the set of valid cards and resolving conflicts includes: Get the visibility mapping, order list, and top setting; Configure port capability constraints, test security constraints, and card dependency constraints for all cards in the valid card set; Configure user preferences for showing / hiding, sorting, and pinning all cards in the valid card set based on the show / hide mapping, order list, and pinning settings. Configure the system's default order for all cards in the valid card set.
8. The card dynamic layout display method according to claim 6, characterized in that, The method for merging user preferences in the set of valid cards and resolving conflicts further includes: When user preferences conflict with port capabilities, the card will not enter the running layout, but the configuration record will be retained; When a user preference requests to hide a card that must be retained, or requests to hide a preceding card that is depended on by other cards, retain the card and record the reason why the user preference did not take effect; When the user order in user preferences violates the dependency relationship, the user order is corrected according to the directed dependency graph.
9. The card dynamic layout display method according to claim 1, characterized in that, The method for generating a pagination layout based on card priority using the original layout includes: Calculate dynamic priorities and arrange the cards accordingly; Pagination is performed based on card size, container width in the original layout, and page capacity to generate a paginated layout.
10. The card dynamic layout display method according to claim 9, characterized in that, The method for calculating dynamic priorities and arranging cards includes: Calculate dynamic priority; Sorting cards according to dynamic priority while satisfying dependency order; When a new card is inserted, the dynamic priority difference between the new card and the old card is compared. If the dynamic priority difference does not exceed the swap threshold, the original position is maintained; otherwise, the relative order between the new card and the old card is adjusted.
11. The card dynamic layout display method according to claim 1, characterized in that, The method for scheduling data acquisition tasks based on pagination layout and card status includes: Schedule data collection tasks based on the visibility level of the card in the pagination layout and the real-time data level. Listen to the port context and process the cards affected by changes in the port context fields to update the set of valid cards, card priorities, and pagination layout.
12. The card dynamic layout display method according to claim 1, characterized in that, The method for scheduling data acquisition tasks based on pagination layout and card status further includes: When multiple cards request the same data object on the same port, a shared task key is constructed based on the port identifier, data object, channel range, and parameter summary. Cards with the same shared task key reuse the same in-transit request or cached result.
13. The card dynamic layout display method according to claim 1, characterized in that, The card dynamic layout display method further includes: Based on the detailed function location information saved in the card, enter the corresponding detailed function page; The display space is reallocated when the card area expands or collapses, while retaining the port overview view; When the window size, top area height, or card area status changes, recalculate the card area height and port overview view height. If the calculated height of the port overview view is lower than the preset height threshold, the port overview view will be switched to a scroll layout or hidden.
14. A card dynamic layout display system, used to implement the card dynamic layout display method as described in any one of claims 1 to 13, characterized in that, The card dynamic layout display system includes: The context acquisition module is used to obtain the port context of the target port; The valid card generation module is used to read the capability descriptions of candidate cards and generate a set of valid cards based on the port context and hard constraints. The pagination layout generation module is used to generate a pagination layout based on the card priority and the original layout. The data acquisition scheduling module is used to schedule data acquisition tasks based on the pagination layout and card status. The page display module is used to display the data information acquired by each data collection task corresponding to each card in real time in a paginated layout.
15. The card dynamic layout display system according to claim 14, characterized in that, The card dynamic layout display system also includes: The page location module is used to navigate to the corresponding detailed function page based on the detailed function location information stored in the card. The partitioned display module is used to reallocate display space when the card area expands or collapses, while retaining the port overview view; it is also used to recalculate the card area height and port overview view height when the window size, top area height, or card area status changes; if the calculated port overview view height is lower than a preset height threshold, the port overview view is switched to a scrolling layout or the port overview view is hidden.
16. An electronic device, characterized in that, It includes a memory, a processor, and an executable program stored in the memory and capable of being run by the processor; when the processor runs the executable program, it performs the card dynamic layout display method as described in any one of claims 1 to 13.
17. A computer storage medium, characterized in that, The computer storage medium stores an executable program; when the executable program is executed, it implements the card dynamic layout display method as described in any one of claims 1 to 13.
