Node adjusting method, routing menu dynamic generation method and device
By dynamically updating the node sorting value and parent node identity, the cumbersome problem of routing management in front-end development is solved, and the efficiency of routing relationship adjustment and system stability are achieved.
Patent Information
- Application Number
- CN202411748390.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2024-12-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In front-end development, routing management requires manual modification of code and configuration files, resulting in poor project stability and cumbersome operations, especially when routing relationship adjustments, it is necessary to re-open the system, resulting in service interruption.
Provide a node adjustment method and a dynamic generation method for routing menus. By responding to the routing modification instructions delivered by the terminal, dynamically update the sorting value of the mobile node and the parent node identification based on the sorting value of the reference node and the node sorting list stored by the server to avoid Re-launch the system and simplify the node modification steps.
It reduces service interruptions caused by system restart, improves system stability and operation efficiency, simplifies the node modification process, and does not require re-opening of the entire system.
Smart Images

Figure CN119232634A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and more specifically to a node adjustment method, a routing menu dynamic generation method and a device. Background Art
[0002] In front-end development, routing management is a key part of building single-page applications. Routing allows users to access different parts of the application through different links without reloading the entire page.
[0003] In the related art, the front-end development project needs to manually modify the relevant code when making routing modifications. After the code is launched, when the routing relationship needs to be adjusted later, the configuration file needs to be modified and put back online, which is not conducive to the stable operation of the project and is relatively cumbersome. Summary of the invention
[0004] In view of the above problems, the present invention provides a node adjustment method, a routing menu dynamic generation method and a device.
[0005] According to a first aspect of the present invention, a node adjustment method is provided, which is applied to a server, comprising: in response to receiving a route modification instruction from a terminal, when the movement type in the route modification instruction is a first movement type, obtaining a target ranking value of the mobile node based on the ranking value of the reference node and the node ranking list stored in the server, the route modification instruction also comprising a mobile node identifier and a reference node identifier, the reference node identifier being a node identifier used as a reference after the mobile node has moved, the node ranking list comprising the ranking values of all nodes arranged in order; determining the parent node identifier of the reference node obtained based on the reference node identifier as the target parent node identifier of the mobile node; and updating the ranking value and parent node identifier of the mobile node based on the target ranking value and the target parent node identifier.
[0006] According to an embodiment of the present invention, the target ranking value of the mobile node is obtained based on the ranking value of the reference node and the node ranking list, including: based on the ranking value of the reference node and the node ranking list, obtaining the index value of the ranking value in the node ranking list, the index value of the reference node is i, i is an integer greater than or equal to 0; when the index value is not a preset value, obtaining the target ranking value of the mobile node according to the ranking value of the i+1th node in the node ranking list and the ranking value of the ith node in the node ranking list.
[0007] According to an embodiment of the present invention, the method further comprises: when the index value is the preset value, obtaining the target ranking value of the mobile node according to the ranking value of the reference node.
[0008] According to an embodiment of the present invention, the above method also includes: when the above movement type is the second movement type, based on the sorting value of the above reference node and the above node sorting list, obtaining the index value of the above sorting value in the above node sorting list, the index value of the above reference node is k, k is an integer greater than or equal to 0, the number of nodes in the above node sorting list is M, M is an integer greater than or equal to 1, and the above second movement type represents that the above mobile node moves to the last node of the level where the above reference node is located; when the above node index value is less than M-1, the target sorting value of the above mobile node is obtained according to the sorting value of the k+1th node in the above node sorting list and the sorting value of the k+2th node in the above node sorting list.
[0009] According to an embodiment of the present invention, the method further comprises: when the index value k is equal to M-1, obtaining the target ranking value of the mobile node according to the ranking value of the reference node.
[0010] According to an embodiment of the present invention, the above method also includes: when the above mobility type is a third mobility type, the above reference node identifier is determined as the target parent node identifier of the above mobile node, and the above third mobility type represents that the above mobile node moves to the secondary level of the above reference node as a child node of the above reference node.
[0011] The second aspect of the present invention provides a method for dynamically generating a routing menu, which is applied to a terminal and includes: in response to monitoring that a drag operation on a node in a page stops, obtaining a mobile node identifier, a reference node identifier and a mobile type; sending a routing modification instruction to a server, the routing modification instruction including the mobile node identifier, the reference node identifier and the mobile type; in response to receiving a modification completion message returned by the server, refreshing the page.
[0012] According to an embodiment of the present invention, before the dragging operation of the node in the above-mentioned monitoring page, it also includes: in response to the target user login completion message returned by the above-mentioned server, generating a routing menu according to the routing data in the above-mentioned target user login completion message, the above-mentioned routing data has a corresponding relationship with the above-mentioned target user, and the above-mentioned routing menu includes multiple nodes with a hierarchical relationship.
[0013] The third aspect of the present invention provides a node adjustment device, including: a target ranking value acquisition module, which is used to respond to receiving a route modification instruction from a terminal, and when the movement type in the above-mentioned route modification instruction is the first movement type, obtain the target ranking value of the mobile node based on the ranking value of the reference node and the node ranking list stored in the above-mentioned server. The above-mentioned route modification instruction also includes a mobile node identifier and a reference node identifier. The above-mentioned reference node identifier is a node identifier used as a reference after the above-mentioned mobile node moves. The above-mentioned node ranking list includes the ranking values of all nodes arranged in order; a determination module, which is used to determine the parent node identifier of the reference node obtained based on the above-mentioned reference node identifier as the target parent node identifier of the above-mentioned mobile node; an update module, which is used to update the ranking value and parent node identifier of the above-mentioned mobile node based on the above-mentioned target ranking value and the above-mentioned target parent node identifier.
[0014] According to an embodiment of the present invention, the above-mentioned target ranking value acquisition module includes: a first index value acquisition sub-module, which is used to obtain the index value of the above-mentioned ranking value in the above-mentioned node ranking list based on the ranking value of the above-mentioned reference node and the above-mentioned node ranking list, the index value of the above-mentioned reference node is i, and i is an integer greater than or equal to 0; a first target ranking value determination sub-module, which is used to obtain the target ranking value of the above-mentioned mobile node according to the ranking value of the i-th node in the above-mentioned node ranking list and the ranking value of the i-1-th node in the above-mentioned node ranking list when the above-mentioned index value is not a preset value.
[0015] According to an embodiment of the present invention, the device further includes: a second target ranking value determination submodule, which is used to obtain the target ranking value of the mobile node according to the ranking value of the i-th node in the node ranking list and the ranking value of the i-1-th node in the node ranking list when the index value is not a preset value.
[0016] According to an embodiment of the present invention, the above-mentioned device also includes: a second index value acquisition submodule, which is used to obtain the index value of the above-mentioned sorting value in the above-mentioned node sorting list based on the sorting value of the above-mentioned reference node and the above-mentioned node sorting list when the above-mentioned movement type is the second movement type, the index value of the above-mentioned reference node is k, k is an integer greater than or equal to 0, the number of nodes in the above-mentioned node sorting list is M, M is an integer greater than or equal to 1, and the above-mentioned second movement type represents that the above-mentioned mobile node moves to the last node of the level where the above-mentioned reference node is located; a third target sorting value determination submodule, which is used to obtain the target sorting value of the above-mentioned mobile node according to the sorting value of the kth node in the above-mentioned node sorting list and the sorting value of the k+1th node in the above-mentioned node sorting list when the above-mentioned node index value is less than M-1.
[0017] According to an embodiment of the present invention, the above-mentioned device also includes: a fourth target ranking value determination submodule, which is used to obtain the target ranking value of the above-mentioned mobile node according to the ranking value of the above-mentioned reference node when the above-mentioned node index value is equal to M-1.
[0018] According to an embodiment of the present invention, the above-mentioned device also includes: a target parent node determination module, which is used to determine the above-mentioned reference node identifier as the target parent node identifier of the above-mentioned mobile node when the above-mentioned mobile type is a third mobile type, and the above-mentioned third mobile type represents that the above-mentioned mobile node moves to the secondary level of the above-mentioned reference node as a child node of the above-mentioned reference node.
[0019] The fourth aspect of the present invention provides a device for dynamically generating a routing menu, comprising: an acquisition module, used to acquire a mobile node identifier, a reference node identifier and a movement type in response to monitoring that a drag operation on a node in a page has stopped; a sending module, used to send a routing modification instruction to a server, the routing modification instruction including the mobile node identifier, the reference node identifier and the movement type; a refresh module, used to refresh the page in response to receiving a modification completion message returned by the server.
[0020] According to an embodiment of the present invention, the above-mentioned device also includes: a routing menu generation module, which is used to respond to the target user login completion message returned by the above-mentioned server, and generate a routing menu according to the routing data in the above-mentioned target user login completion message, the above-mentioned routing data has a corresponding relationship with the above-mentioned target user, and the above-mentioned routing menu includes multiple nodes with a hierarchical relationship.
[0021] The fifth aspect of the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned node adjustment method.
[0022] The sixth aspect of the present invention also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned node adjustment method.
[0023] The seventh aspect of the present invention also provides a computer program product, including a computer program, which implements the above-mentioned node adjustment method when executed by a processor.
[0024] According to an embodiment of the present invention, by obtaining the mobile node identifier, reference node identifier and mobile type transmitted by the terminal at the service end, when the mobile type is the first mobile type, the target sorting value of the mobile node is determined according to the sorting value of the reference node and the node sorting list in the service end, and the parent node identifier of the reference node is determined as the target parent node identifier of the mobile node, and the sorting value and parent node identifier of the mobile node are updated, so that there is no need to re-launch the entire system after modifying the routing sorting, thereby reducing service interruptions caused by system restart and improving system stability. Furthermore, the node modification steps are simplified to improve operational efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The above contents and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0026] Figure 1 An application scenario diagram of a node adjustment method, a routing menu dynamic generation method, and a device according to an embodiment of the present invention is shown;
[0027] Figure 2 A flowchart of a node adjustment method according to an embodiment of the present invention is shown;
[0028] Figure 3 A flow chart of a method for dynamically generating a routing menu according to an embodiment of the present invention is shown;
[0029] Figure 4 It shows a structural block diagram of a node adjustment device according to an embodiment of the present invention;
[0030] Figure 5 It shows a structural block diagram of a device for dynamically generating a routing menu according to an embodiment of the present invention;
[0031] Figure 6 A block diagram of an electronic device suitable for implementing a node adjustment method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0032] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.
[0033] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0034] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0035] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0036] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0037] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present invention provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.
[0038] In the traditional front-end development model, the configuration of page routing is usually static and needs to be managed manually by relevant personnel. When a new page is added to the project, relevant personnel must manually add the corresponding routing rules to the routing configuration. Similarly, if the hierarchical relationship of the page needs to be adjusted or the page path needs to be changed, relevant personnel are also required to modify the code, which increases the possibility of errors, and each change requires manual editing of the code, which is time-consuming and inefficient. As the scale of the project expands, the routing configuration becomes more and more complex, and it is more difficult to maintain and update the routing.
[0039] In view of this, an embodiment of the present invention provides a node adjustment method, which is applied to a server, and the method includes: in response to receiving a route modification instruction from a terminal, when the movement type in the route modification instruction is the first movement type, based on the ranking value of the reference node and the node ranking list stored in the server, a target ranking value of the mobile node is obtained, the route modification instruction also includes a mobile node identifier and a reference node identifier, the reference node identifier is a node identifier used as a reference after the mobile node moves, and the node ranking list includes the ranking values of all nodes arranged in order; the parent node identifier of the reference node obtained based on the reference node identifier is determined as the target parent node identifier of the mobile node; the ranking value and parent node identifier of the mobile node are updated based on the target ranking value and the target parent node identifier.
[0040] Figure 1 An application scenario diagram of a node adjustment method, a routing menu dynamic generation method, and a device according to an embodiment of the present invention is shown.
[0041] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0042] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0043] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0044] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0045] It should be noted that the node adjustment method provided in the embodiment of the present invention can generally be executed by the server 105, and the routing menu dynamic generation method provided in the embodiment of the present invention can generally be executed by the first terminal device 101, the second terminal device 102, and the third terminal device 103. Accordingly, the node adjustment device provided in the embodiment of the present invention can generally be set in the server 105, and the routing menu dynamic generation device provided in the embodiment of the present invention can generally be set in the first terminal device 101, the second terminal device 102, and the third terminal device 103. The node adjustment method provided in the embodiment of the present invention can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the node adjustment device provided in the embodiment of the present invention can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0046] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0047] The following will be based on Figure 1 The scene described by Figure 2 The node adjustment method according to the embodiment of the present invention is described in detail.
[0048] Figure 2 A flow chart of a node adjustment method according to an embodiment of the present invention is shown.
[0049] like Figure 2 As shown, the node adjustment method of this embodiment includes operations S210 to S230.
[0050] In operation S210, in response to receiving a route modification instruction from a terminal, when the mobility type in the route modification instruction is a first mobility type, a target ranking value of the mobile node is obtained based on the ranking value of the reference node and a node ranking list stored in the server.
[0051] The route modification instruction further includes a mobile node identifier and a reference node identifier. The reference node identifier is a node identifier used as a reference after the mobile node moves. The node sorting list includes sorting values of all nodes arranged in order.
[0052] According to an embodiment of the present invention, the above-mentioned first mobility type can represent that before the mobile node is moved to the reference node, after the server receives the mobile node identifier, reference node identifier and mobility type, it decides how to modify the parent node identifier and sorting value stored in the mobile node according to the mobility type.
[0053] In operation S220, the parent node identifier of the reference node obtained based on the reference node identifier is determined as the target parent node identifier of the mobile node.
[0054] According to an embodiment of the present invention, a node in the database of the server has field attributes such as node name, display or not, menu id, menu route, parent node identifier, sort value, etc., wherein the nodes stored in the database have a hierarchical relationship, and the hierarchical relationship may be, for example, that all nodes can form a tree structure.
[0055] In operation S230, the ranking value and the parent node identifier of the mobile node are updated based on the target ranking value and the target parent node identifier.
[0056] According to an embodiment of the present invention, by obtaining the mobile node identifier, reference node identifier and mobile type transmitted by the terminal at the service end, when the mobile type is the first mobile type, the target sorting value of the mobile node is determined according to the sorting value of the reference node and the node sorting list in the service end, and the parent node identifier of the reference node is determined as the target parent node identifier of the mobile node, and the sorting value and parent node identifier of the mobile node are updated, so that there is no need to re-launch the entire system after modifying the routing sorting, thereby reducing service interruptions caused by system restart and improving system stability. Furthermore, the node modification steps are simplified to improve operational efficiency.
[0057] According to an embodiment of the present invention, a target ranking value of a mobile node is obtained based on a ranking value of a reference node and a node ranking list, including: based on the ranking value of the reference node and the node ranking list, obtaining an index value of the ranking value in the node ranking list, the index value of the reference node is i, and i is an integer greater than or equal to 0; when the index value is not a preset value, obtaining the target ranking value of the mobile node based on the ranking value of the i-th node in the node ranking list and the ranking value of the i-1-th node in the node ranking list.
[0058] According to the embodiment of the present invention, the preset value may be, for example, 0, or other natural numbers, and the present invention is not limited thereto.
[0059] According to an embodiment of the present invention, the above target ranking value can be calculated by the following formula (1).
[0060] (1)
[0061] Among them, Sort new It represents the target sorting value of the mobile node, Sortlist[i+1] represents the sorting value of the i+1th node in the node sorting list, and Sortlist[i] represents the sorting value of the i-th node in the node sorting list.
[0062] For example, for the data whose sorting value of the reference node is 3 and the node sorting list is [1,2,3,4], the index value of the sorting value in the node sorting list is 2. At this time, the movement type is the first movement type. The target sorting value of the mobile node can be obtained as 2.5 based on the sorting value 3 of the third node in the node sorting list and the sorting value 2 of the second node. The sorting value of the mobile node in the database is modified according to the target sorting value.
[0063] According to an embodiment of the present invention, when the index value is a preset value, the target ranking value of the mobile node is obtained according to the ranking value of the reference node.
[0064] According to an embodiment of the present invention, the target ranking value of the mobile node may be, for example, the ranking value of the reference node divided by 2.
[0065] According to an embodiment of the present invention, when obtaining the ranking value of a node in a sorted list, the ranking value of the corresponding node in the sorted list may be directly obtained according to the index value.
[0066] Exemplarily, for the data where the ranking value of the reference node is 1 and the node ranking list is [1,2,3,4], the index value of the reference node is 0, and the target ranking value of the mobile node is 0.5, the ranking value of the mobile node in the database is modified according to the target ranking value.
[0067] According to an embodiment of the present invention, by calculating the index value of the reference node in the node sorting list to determine how to determine the target sorting value of the mobile node, different strategies can be flexibly selected to calculate the target sorting value, and the performance of the sorting adjustment can be improved by quickly locating and calculating the index value.
[0068] According to an embodiment of the present invention, the above method also includes, when the movement type is the second movement type, based on the sorting value of the reference node and the node sorting list, obtaining the index value of the sorting value in the node sorting list, the index value of the reference node is k, k is an integer greater than or equal to 0, the number of nodes in the node sorting list is M, M is an integer greater than or equal to 1, and the second movement type represents that the mobile node moves to the last node of the level where the reference node is located; when the node index value is less than M-1, the target sorting value of the mobile node is obtained according to the sorting value of the k+1th node in the node sorting list and the sorting value of the k+2th node in the node sorting list.
[0069] According to the embodiment of the present invention, a node index value equal to M-1 indicates that the reference node is the last node in the node sorting list.
[0070] According to an embodiment of the present invention, the above target ranking value can be calculated by the following formula (2).
[0071] (2)
[0072] Among them, Sort new It represents the target sorting value of the mobile node, Sortlist[k+1] represents the sorting value of the k+1th node in the node sorting list, and Sortlist[k+2] represents the sorting value of the k+2th node in the node sorting list.
[0073] For example, for the data whose sorting value of the reference node is 3 and the node sorting list is [1,2,3,4], the index value of the sorting value in the node sorting list is 2. At this time, the movement type is the second movement type. The target sorting value of the mobile node can be obtained as 3.5 based on the sorting value 3 of the third node and the sorting value 4 of the fourth node in the node sorting list. The sorting value of the mobile node in the database is modified according to the target sorting value.
[0074] According to an embodiment of the present invention, the method further comprises: when the node index value is equal to M-1, obtaining the target ranking value of the mobile node according to the ranking value of the reference node.
[0075] According to an embodiment of the present invention, the target ranking value of the mobile node may be, for example, the ranking value of the reference node plus 1.
[0076] For example, for the reference node whose ranking value is 4 and the node ranking list is [1,2,3,4], the number of nodes M in the node ranking list is 4, and the index value of the reference node in the node ranking list is 3, which is equal to M-1, then the target ranking value of the mobile node is 5.
[0077] According to an embodiment of the present invention, the above method also includes: when the mobility type is the third mobility type, the reference node identifier is determined as the target parent node identifier of the mobile node, and the third mobility type represents that the mobile node moves to the secondary level of the reference node as a child node of the reference node.
[0078] According to an embodiment of the present invention, the third movement type may also represent that the node moves to a parent node as the only child node, and the present invention does not impose any limitation on this.
[0079] According to an embodiment of the present invention, when the mobility type is the third mobility type, mobile node data corresponding to the mobile node identifier stored in the database can be obtained according to the mobile node identifier, and the parent node identifier of the mobile node can be modified to the parent node identifier of the reference node.
[0080] According to an embodiment of the present invention, by judging the mobile type transmitted by the mobile terminal, operations on the mobile node data are distinguished. When it is determined to be the third mobile type, only the parent node identifier corresponding to the mobile node needs to be modified, thereby speeding up the node sorting speed. By referring to the index value of the node in the node sorting list to further judge and classify when the mobile type is determined, the situation where the mobile node is moved to the last node can be handled in a targeted manner.
[0081] The following will be based on Figure 1 The scene described by Figure 3 The method for dynamically generating a routing menu according to an embodiment of the present invention is described in detail.
[0082] Figure 3 A flow chart of a method for dynamically generating a routing menu according to an embodiment of the present invention is shown.
[0083] like Figure 3 As shown, the method for dynamically generating a routing menu in this embodiment includes operations S310 to S330.
[0084] In operation S310, in response to monitoring that the drag operation on a node in a page stops, a moving node identifier, a reference node identifier, and a moving type are acquired.
[0085] According to an embodiment of the present invention, the terminal can adopt a front-end component and reference the three events of "node-drag-start, node-drag-end, node-drop" therein to obtain the mobile node identifier, reference node identifier and mobile type through the three events. It can also write code by itself to monitor the dragging operation of the nodes in the page to obtain the corresponding mobile node identifier, reference node identifier and mobile type. The present invention does not limit the method for obtaining the mobile node identifier, reference node identifier and mobile type.
[0086] In operation S320, a route modification instruction is sent to the server, where the route modification instruction includes a mobile node identifier, a reference node identifier, and a mobile type.
[0087] In operation S330, in response to receiving a modification completion message returned by the server, the page is refreshed.
[0088] Exemplarily, if the hierarchical relationship is modified after dragging, it can be determined as the third movement type, and the parent node can be determined as the reference node. For movement within the same level, if the mobile node does not move to the last node of the level, the movement type can be determined as the first movement type, and the node after the mobile node after the movement is completed can be determined as the reference node. If the mobile node moves to the last node of the level, the movement type can be determined as the second movement type, and the node before the mobile node after the movement can be determined as the reference node.
[0089] According to an embodiment of the present invention, after the user finishes dragging, the dragging result can be displayed to the user and a prompt message can be displayed on the terminal at the same time. For example, it can be "Modifying, please wait" and the user is prohibited from performing further operations to ensure the atomicity of the operation. After receiving the modification completion message returned by the server, the page is refreshed and the moved routing menu is displayed.
[0090] According to an embodiment of the present invention, by monitoring the end of the drag operation in the page, the system can obtain the mobile node identifier, reference node identifier and mobile type, so that the server can calculate the target ranking value of the mobile node in a targeted manner, and allow the user to reorder by dragging the operation, providing the user with a friendly interface operation experience.
[0091] According to an embodiment of the present invention, before monitoring the drag operation of a node in a page, it also includes: responding to a target user login completion message returned by the server, generating a routing menu according to routing data in the target user login completion message, the routing data having a corresponding relationship with the target user, and the routing menu including multiple nodes with a hierarchical relationship.
[0092] According to an embodiment of the present invention, the detailed development of the directory page can be completed in the terminal first and the corresponding page mapping file can be set. The page module operation, directory display name and corresponding route name can be entered through the terminal. The subordinate relationship between the pages (that is, the subordinate relationship between the routes) can be entered in the directory tree module operation of the terminal.
[0093] According to an embodiment of the present invention, the terminal can adopt dynamic routing, that is, a basic empty route is set in the terminal. After the user completes the page login, the routing data carried in the user login completion message is obtained, and the corresponding mapping file is obtained according to the routing name in the routing data, and written into the above-mentioned basic empty route to generate directory routing data with a hierarchical relationship.
[0094] According to an embodiment of the present invention, the terminal can also control the display route according to the user role carried in the user login completion message. A userRouteObj object can be set, which references the corresponding js file or script file in a reference form, and configures the corresponding relationship in the js file. For example, the user role page under the user relationship can configure the user role in the corresponding js file and introduce the corresponding mapping relationship.
[0095] According to an embodiment of the present invention, by dynamically generating routing data after a user logs in and displaying a routing menu corresponding to a user according to the identity or role data of different users, data leakage can be prevented, and dynamic routing can support modification of routing at the terminal, thereby improving the flexibility and maintainability of the application.
[0096] Based on the above-mentioned method for dynamically generating a routing menu, the present invention also provides a node adjustment device. Figure 4 The device is described in detail.
[0097] Figure 4 A structural block diagram of a node adjustment device according to an embodiment of the present invention is shown.
[0098] like Figure 4 As shown, the node adjustment device 400 of this embodiment includes a target ranking value acquisition module 410 , a determination module 420 and an update module 430 .
[0099] The target ranking value acquisition module 410 is used to obtain the target ranking value of the mobile node based on the ranking value of the reference node and the node ranking list stored in the server in response to receiving the route modification instruction from the terminal, when the movement type in the route modification instruction is the first movement type, and the route modification instruction also includes the mobile node identifier and the reference node identifier, the reference node identifier is the node identifier used as a reference after the mobile node moves, and the node ranking list includes the ranking values of all nodes arranged in order. In one embodiment, the target ranking value acquisition module 410 can be used to perform the operation S210 described above, which will not be repeated here.
[0100] The determination module 420 is used to determine the parent node identifier of the reference node obtained based on the reference node identifier as the target parent node identifier of the mobile node. In one embodiment, the determination module 420 can be used to perform the operation S220 described above, which will not be described in detail here.
[0101] The updating module 430 is used to update the ranking value and the parent node identifier of the mobile node based on the target ranking value and the target parent node identifier. In one embodiment, the updating module 430 can be used to perform the operation S230 described above, which will not be described in detail here.
[0102] According to an embodiment of the present invention, the above-mentioned target ranking value acquisition module includes: a first index value acquisition sub-module, which is used to obtain the index value of the above-mentioned ranking value in the above-mentioned node ranking list based on the ranking value of the above-mentioned reference node and the above-mentioned node ranking list, the index value of the above-mentioned reference node is i, and i is an integer greater than or equal to 0; a first target ranking value determination sub-module, which is used to obtain the target ranking value of the above-mentioned mobile node according to the ranking value of the i-th node in the above-mentioned node ranking list and the ranking value of the i-1-th node in the above-mentioned node ranking list when the above-mentioned index value is not a preset value.
[0103] According to an embodiment of the present invention, the device further includes: a second target ranking value determination submodule, which is used to obtain the target ranking value of the mobile node according to the ranking value of the i-th node in the node ranking list and the ranking value of the i-1-th node in the node ranking list when the index value is not a preset value.
[0104] According to an embodiment of the present invention, the above-mentioned device also includes: a second index value acquisition submodule, which is used to obtain the index value of the above-mentioned sorting value in the above-mentioned node sorting list based on the sorting value of the above-mentioned reference node and the above-mentioned node sorting list when the above-mentioned movement type is the second movement type, the index value of the above-mentioned reference node is k, k is an integer greater than or equal to 0, the number of nodes in the above-mentioned node sorting list is M, M is an integer greater than or equal to 1, and the above-mentioned second movement type represents that the above-mentioned mobile node moves to the last node of the level where the above-mentioned reference node is located; a third target sorting value determination submodule, which is used to obtain the target sorting value of the above-mentioned mobile node according to the sorting value of the kth node in the above-mentioned node sorting list and the sorting value of the k+1th node in the above-mentioned node sorting list when the above-mentioned node index value is less than M-1.
[0105] According to an embodiment of the present invention, the above-mentioned device also includes: a fourth target ranking value determination submodule, which is used to obtain the target ranking value of the above-mentioned mobile node according to the ranking value of the above-mentioned reference node when the above-mentioned node index value is equal to M-1.
[0106] According to an embodiment of the present invention, the above-mentioned device also includes: a target parent node determination module, which is used to determine the above-mentioned reference node identifier as the target parent node identifier of the above-mentioned mobile node when the above-mentioned mobile type is a third mobile type, and the above-mentioned third mobile type represents that the above-mentioned mobile node moves to the secondary level of the above-mentioned reference node as a child node of the above-mentioned reference node.
[0107] According to an embodiment of the present invention, any multiple modules of the target ranking value acquisition module 410, the determination module 420 and the update module 430 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the target ranking value acquisition module 410, the determination module 420 and the update module 430 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the target ranking value acquisition module 410, the determination module 420 and the update module 430 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0108] Based on the above-mentioned method for dynamically generating a routing menu, the present invention also provides a device for dynamically generating a routing menu. Figure 5 The device is described in detail.
[0109] Figure 5 A structural block diagram of a device for dynamically generating a routing menu according to an embodiment of the present invention is shown.
[0110] like Figure 5 As shown, the routing menu dynamic generation device 500 of this embodiment includes an acquisition module 510 , a sending module 520 and a refresh module 530 .
[0111] The acquisition module 510 is used to acquire the moving node identifier, the reference node identifier and the moving type in response to monitoring the stopping of the dragging operation on the node in the page. In one embodiment, the acquisition module 510 can be used to perform the operation S310 described above, which will not be repeated here.
[0112] The sending module 520 is used to send a route modification instruction to the server, and the route modification instruction includes a mobile node identifier, a reference node identifier and a mobile type. In one embodiment, the sending module 520 can be used to perform the operation S320 described above, which will not be repeated here.
[0113] The refresh module 530 is used to refresh the page in response to receiving the modification completion message returned by the server. In one embodiment, the refresh module 530 can be used to perform the operation S330 described above, which will not be repeated here.
[0114] According to an embodiment of the present invention, the above-mentioned device also includes: a routing menu generation module, which is used to respond to the target user login completion message returned by the above-mentioned server, and generate a routing menu according to the routing data in the above-mentioned target user login completion message, the above-mentioned routing data has a corresponding relationship with the above-mentioned target user, and the above-mentioned routing menu includes multiple nodes with a hierarchical relationship.
[0115] According to an embodiment of the present invention, any multiple modules among the acquisition module 510, the sending module 520 and the refresh module 530 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the acquisition module 510, the sending module 520 and the refresh module 530 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the acquisition module 510, the sending module 520 and the refresh module 530 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0116] Figure 6 A block diagram of an electronic device suitable for implementing a node adjustment method according to an embodiment of the present invention is shown.
[0117] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present invention includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0118] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in the one or more memories.
[0119] According to an embodiment of the present invention, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0120] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.
[0121] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.
[0122] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the node adjustment method provided by the embodiment of the present invention.
[0123] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when it is executed by the processor 601. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0124] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0125] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present invention are performed. According to the embodiment of the present invention, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0126] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0127] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0128] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present invention may be combined and / or combined in various ways, even if such combinations and / or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments and / or claims of the present invention may be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All of these combinations and / or combinations fall within the scope of the present invention.
[0129] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination. The scope of the present invention is defined by the attached claims and their equivalents. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A node adjustment method, characterized in that: The method is applied to the server, and the method includes: In response to receiving a route modification instruction from a terminal, when the movement type in the route modification instruction is a first movement type, obtaining a target ranking value of the mobile node based on the ranking value of the reference node and the node ranking list stored by the server, the route modification instruction further comprising a mobile node identifier and a reference node identifier, the reference node identifier being a node identifier used as a reference after the mobile node has finished moving, and the node ranking list comprising the ranking values of all nodes arranged in order; Determine the parent node identifier of the reference node obtained based on the reference node identifier as the target parent node identifier of the mobile node; The ranking value and the parent node identifier of the mobile node are updated based on the target ranking value and the target parent node identifier.
2. The method according to claim 1, characterized in that The obtaining the target ranking value of the mobile node based on the ranking value of the reference node and the node ranking list includes: Based on the ranking value of the reference node and the node ranking list, obtaining an index value of the ranking value in the node ranking list, where the index value of the reference node is i, and i is an integer greater than or equal to 0; When the index value is not a preset value, the target ranking value of the mobile node is obtained according to the ranking value of the i+1th node in the node ranking list and the ranking value of the ith node in the node ranking list.
3. The method according to claim 2, characterized in that The method further comprises: In a case where the index value is the preset value, the target ranking value of the mobile node is obtained according to the ranking value of the reference node.
4. The method according to claim 1, characterized in that: The method further comprises: In the case where the movement type is the second movement type, based on the ranking value of the reference node and the node ranking list, a node index value of the ranking value in the node ranking list is obtained, the index value of the reference node is k, k is an integer greater than or equal to 0, the number of nodes in the node ranking list is M, M is an integer greater than or equal to 1, and the second movement type represents that the mobile node moves to the last node of the level where the reference node is located; When the node index value is less than M-1, the target ranking value of the mobile node is obtained according to the ranking value of the k+1th node in the node ranking list and the ranking value of the k+2th node in the node ranking list.
5. The method according to claim 4, characterized in that The method further comprises: When the node index value is equal to M-1, the target ranking value of the mobile node is obtained according to the ranking value of the reference node.
6. The method according to claim 1, characterized in that The method further comprises: When the mobility type is the third mobility type, the reference node identifier is determined as the target parent node identifier of the mobile node, and the third mobility type indicates that the mobile node moves to the secondary level of the reference node as a child node of the reference node.
7. A method for dynamically generating a routing menu, characterized in that: The method is applied to a terminal, and the method includes: In response to monitoring that the drag operation on the node in the page stops, obtaining the moving node identifier, the reference node identifier and the moving type; Sending a route modification instruction to the server, wherein the route modification instruction includes the mobile node identifier, the reference node identifier and the mobile type; In response to receiving a modification completion message returned by the server, the page is refreshed.
8. The method according to claim 7, characterized in that Before the dragging operation of the node in the monitoring page, the following is also included: In response to the target user login completion message returned by the server, a routing menu is generated according to the routing data in the target user login completion message, the routing data has a corresponding relationship with the target user, and the routing menu includes multiple nodes with a hierarchical relationship.
9. A node adjustment device, characterized in that: The device is installed on the server side, and comprises: a target ranking value acquisition module, configured to obtain, in response to receiving a route modification instruction from a terminal, a target ranking value of a mobile node based on a ranking value of a reference node and a node ranking list stored in the server when the movement type in the route modification instruction is a first movement type, wherein the route modification instruction further includes a mobile node identifier and a reference node identifier, wherein the reference node identifier is a node identifier used as a reference after the mobile node has finished moving, and the node ranking list includes ranking values of all nodes arranged in order; A determination module, configured to determine the parent node identifier of the reference node obtained based on the reference node identifier as the target parent node identifier of the mobile node; An updating module is used to update the ranking value and the parent node identifier of the mobile node based on the target ranking value and the target parent node identifier.
10. A device for dynamically generating a routing menu, characterized in that: The device is mounted on a terminal, and comprises: An acquisition module, configured to acquire a moving node identifier, a reference node identifier, and a moving type in response to monitoring that a dragging operation on a node in a page stops; A sending module, used for sending a route modification instruction to a server, wherein the route modification instruction includes the mobile node identifier, the reference node identifier and the mobile type; A refresh module is used to refresh the page in response to receiving a modification completion message returned by the server.
Citation Information
Patent Citations
Node dragging method, device and equipment and computer readable medium
CN111782329A
Node adjusting method and device of node tree, electronic device and storage medium
CN115774512A
Tree data structure and node batch moving method thereof
CN116680252A
Object data migration method, device and equipment
CN118897834A
Metadata query method based on distributed file system, and device and storage medium
WO2023093245A1
