Configurable WEB multi-layer expansion layering research and development method and system based on events
By providing a unified event protocol and configuration file to specify the execution order of event functions on the front-end server, the problem of repeated modification of source code after version upgrade is solved, the isolation of R&D resources at each level and infinite level expansion development is realized, and the development resources are reduced Consumption and maintenance costs.
Patent Information
- Application Number
- CN202411560798.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-11
AI Technical Summary
After the version upgrade of the existing technology, the horizontal product source code needs to be repeatedly modified, resulting in high consumption of development resources, high communication and maintenance costs, and only supports one layer of expansion, and cannot support unlimited levels of expansion development.
By providing a unified event protocol on the front-end server, obtaining an event mechanism based on the event protocol to write independent front-end scripts, using configuration files to specify the execution order of event functions, forming an event function queue, and achieving isolation and smooth upgrading of R&D resources at each level.
It realizes the source code isolation of R&D resources at each level, supports unlimited levels of extended development, and does not require modification of the source code after the version is upgraded, reducing the consumption and maintenance costs of development resources.
Smart Images

Figure CN119415141A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of computer technology, and in particular to an event-based configurable WEB multi-layer extension and hierarchical research and development method and system. Background Art
[0002] When horizontal products serving enterprises are delivered to a certain industry, there will always be demands that the horizontal products cannot meet. At this time, it is necessary to expand and develop the horizontal products for the industry. Similarly, when industry products are delivered to specific enterprises, the enterprises will also carry out customized local development of the industry products. If the industry or local development directly modifies the source code of the horizontal product, when the horizontal product version is upgraded, the industry or local development will have to obtain the source code of the upgraded horizontal product again and make modifications again.
[0003] In this way, every version upgrade requires industry developers and local developers to repeatedly make modifications based on the latest version of the horizontal product source code; this results in a huge consumption of industry product and localized product development resources, and the horizontal products, industry products, and localized product source codes are directly coupled, resulting in relatively high communication and maintenance costs.
[0004] The problem to be solved in this article is how to isolate the source code of industry development from horizontal products, and isolate the source code of local development from industry products; and ensure that the customized requirements developed by developers at all levels can continue to be used after the horizontal product version is upgraded.
[0005] It can be seen that the above existing systems still have inconveniences and defects in use, and are in urgent need of further improvement. How to create a new event-based configurable WEB multi-layer extension and hierarchical development system and method has become a goal that the industry urgently needs to improve. Summary of the invention
[0006] In view of this, the embodiments of the present disclosure provide an event-based, configurable WEB multi-layer extension and hierarchical R&D method and system to solve the problem that each version upgrade requires repeated modifications based on the horizontal product source code of the latest version, resulting in a huge consumption of development resources, high communication costs and maintenance costs, and only supporting one layer of extension and cannot support unlimited levels of extension development.
[0007] In a first aspect, an embodiment of the present disclosure provides an event-based configurable WEB multi-layer extension and hierarchical development method, which is applied to a front-end server, and the method comprises the following steps:
[0008] The front-end server provides a unified event protocol;
[0009] Obtaining an event mechanism provided by the event protocol to write mutually independent front-end scripts as mutually isolated R&D resources at each layer, wherein the R&D resources at each layer provide event functions;
[0010] Preset the configuration file and load the configuration file information, and specify the execution order of the same event function through the configuration file;
[0011] The event functions are classified and assembled into an event function queue according to the execution order specified by the configuration file to complete the resource preprocessing link;
[0012] The event function queue monitors and executes in the corresponding events.
[0013] According to a specific implementation of the embodiment of the present disclosure, loading the configuration file information includes:
[0014] Get configuration file information;
[0015] Check whether the obtained configuration file information exists;
[0016] If yes, then load the configuration file, the configuration file loads the R&D resource scripts of each layer, and specifies the execution order and activation status of the same event functions provided by the R&D resources of each layer based on the configuration file;
[0017] If not, then load the level development resource script.
[0018] According to a specific implementation of the embodiment of the present disclosure, the execution order and activation status of the same event functions provided by R&D resources at each layer are specified based on the configuration file, including:
[0019] Specify the default script path for each layer of R&D resources and specify the default loading order for each layer of R&D resources;
[0020] Specify the execution order and activation status of page-level event functions registered by R&D resources at each level;
[0021] Specifies the execution order and enabling status of component-level event functions registered by R&D resources at each layer.
[0022] According to a specific implementation of the embodiment of the present disclosure, the execution order and activation status of the page-level event functions registered by the designated R&D resources at each layer include:
[0023] Obtain registration information of R&D resources at all levels;
[0024] Check whether the R&D resources at each layer have registered the same page-level event function;
[0025] If the R&D resources at each layer register the same page-level event function, describe the functions and execution order of the event functions at different layers, and whether to disable the event function at this layer;
[0026] If there is no special declaration of the event function execution order, the R&D resource scripts of each layer will be loaded according to the default loading order.
[0027] According to a specific implementation of the embodiment of the present disclosure, the execution order and activation status of the component-level event functions registered by the R&D resources at each layer are specified, including:
[0028] Obtain registration information of R&D resources at all levels;
[0029] Check whether the R&D resources at each layer have registered the same component-level event function;
[0030] If the R&D resources at each layer register and listen to the same component-level event function, define the role and execution order of the component-level event function at each layer, and you can also disable the event function of a certain layer;
[0031] If there is no special declaration of the event function execution order, the R&D resource scripts of each layer will be loaded according to the default loading order.
[0032] According to a specific implementation of the embodiment of the present disclosure, the event function includes: a page-level event function and a plurality of component-level event functions located at a level below the page-level event function;
[0033] Assembling the page-level event function into a page-level event function queue includes:
[0034] Page initialization event function, business data loading event function, page destruction event function, read the page-level event function queue, and sequentially execute the loading page-level behavior to provide page-level events;
[0035] Assembling the component-level event function into a component-level event function queue includes:
[0036] The button click event function, the form table editing event function, and the table operation event function are used for the R&D resources at each layer to monitor the changes of different component-level events on the page-level events.
[0037] In a second aspect, the present disclosure provides an event-based configurable WEB multi-layer extension hierarchical R&D system, the system comprising:
[0038] An event protocol module, configured to provide a unified event protocol;
[0039] The resource configuration module is configured to preset the configuration file and load the configuration file information, and specify the execution order of the same event function through the configuration file;
[0040] Each layer of R&D resource modules is configured to obtain an event mechanism provided by the event protocol to write independent front-end scripts as mutually isolated R&D resources at each layer, and the R&D resources at each layer provide event functions;
[0041] The resource preprocessing module is configured to classify and assemble the event functions into an event function queue according to the order specified by the resource configuration file module;
[0042] The assembled event function queue listens and executes in the corresponding events of the event protocol module, and the various layers of R&D resource modules assembled by the resource preprocessing module respond to form a complete page service.
[0043] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0044] at least one processor; and,
[0045] a memory communicatively connected to the at least one processor; wherein,
[0046] The memory stores instructions that can be executed by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor implements the event-based configurable WEB multi-layer extension and hierarchical development method as described in any one of the first aspect or any one of the implementations of the first aspect.
[0047] In a fourth aspect, an embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, which stores computer instructions, and when the computer instructions are executed by at least one processor, the at least one processor executes the event-based configurable WEB multi-layer extension layered development method in the aforementioned first aspect or any implementation of the first aspect.
[0048] In the fifth aspect, the embodiments of the present disclosure further provide a computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer executes the event-based configurable WEB multi-layer extension and hierarchical development method in the aforementioned first aspect or any implementation of the first aspect.
[0049] The embodiments of the present invention have the following advantages:
[0050] 1. The event-based configurable WEB multi-layer extension hierarchical development method in the embodiment of the present disclosure provides a unified event protocol through the front-end server, so that each layer of extension development can enhance product services according to unified development rules;
[0051] 2. R&D personnel write independent front-end scripts based on the event mechanism provided by the event protocol, obtain mutually isolated R&D resources at each layer, and the source code of each layer is isolated from each other. Each layer of R&D is oriented to the stable event mechanism programming provided to the outside world for horizontal products, without intruding on the expansion of source code, and can achieve smooth version upgrades;
[0052] 3. Ensure that different versions of products are always backward compatible. After the horizontal product version is upgraded, each layer can expand R&D resources and upgrade smoothly without modification;
[0053] 4. Support unlimited levels of extension development. By modifying the unified configuration file, each level of R&D can flexibly reuse and adjust the order of multi-layer extension development to achieve product customization. R&D personnel can adjust the execution order of each level of R&D resources to maximize code reuse, which is flexible and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The above is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0055] Figure 1 A flowchart of a configurable event-based WEB multi-layer extension and hierarchical development method provided in an embodiment of the present disclosure;
[0056] Figure 2 A schematic diagram of a flow chart of determining a script path and a loading order based on configuration file information obtained according to an embodiment of the present disclosure;
[0057] Figure 3 A schematic diagram of the structure of an event-based configurable WEB multi-layer extension hierarchical R&D system provided in an embodiment of the present disclosure;
[0058] Figure 4 A schematic diagram of a process of a configurable event-based WEB multi-layer extension and hierarchical R&D system provided in an embodiment of the present disclosure;
[0059] Figure 5 A schematic diagram of the structure of an event protocol module provided in an embodiment of the present disclosure;
[0060] Figure 6 A schematic diagram of the script path and loading sequence module of each layer of R&D resources provided in the embodiment of the present disclosure;
[0061] Figure 7 A schematic diagram of a process of performing page initialization in a configurable event-based WEB multi-layer extension and hierarchical development method and system provided in an embodiment of the present disclosure;
[0062] Figure 8 A schematic diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0063] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0064] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0065] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement a device and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0066] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0067] The embodiment of the present invention provides an event-based configurable WEB multi-layer extension hierarchical development method and system. Based on the system structure and starting from the unified event protocol of the front end, an event-based configurable WEB multi-layer extension hierarchical development method is provided, which can isolate the source codes of the research and development resources of each layer from each other. Each layer of research and development is programmed for the stable event mechanism provided to the outside world by the horizontal product, does not invade the extension of the source code and ensures downward compatibility, thereby ensuring that the extended research and development resources of each layer can be smoothly upgraded. The method realizes unlimited levels of extended development. By modifying the unified configuration file, the research and development of each layer can flexibly reuse and adjust the order of multi-layer extension development to achieve the purpose of customized research and development; solves the problem that each version upgrade requires industry development and local development to repeatedly modify the horizontal product source code based on the latest version; resulting in great consumption of industry product and localized product development resources, direct coupling of horizontal products, industry products, and localized product source codes, and high communication costs and maintenance costs.
[0068] Figure 1 The flowchart of the event-based configurable WEB multi-layer extension and hierarchical development method provided in the embodiment of the present disclosure at least includes the following steps S110 to S150.
[0069] like Figure 1 As shown, the method comprises the following steps:
[0070] Step S110: the front-end server provides a unified event protocol;
[0071] Exemplarily, when interacting with users, the front-end development, whether React or Vue, encapsulates a unified event mechanism, and communicates through the event mechanism, so as to reuse the steps shown in the event-based configurable WEB multi-layer extension and hierarchical development method shown in the present invention.
[0072] In an embodiment of the present invention, in step S110, the front-end server provides a unified event protocol, and the standard services such as supply chain, assets, and finance provided by horizontal products are all developed based on the unified event protocol. Industry products developed by industries or multi-layer partners rely on horizontal products; and customized products or solutions are usually personalized and customized for specific enterprises based on industry products. When interacting with users, a unified event mechanism is encapsulated, and the R&D resources of each layer are isolated from each other through communication through the event mechanism, while ensuring backward compatibility, thereby ensuring that the extended R&D resources of each layer can be smoothly upgraded.
[0073] Step S120: Obtain an event mechanism based on the event protocol to write independent front-end scripts as mutually isolated R&D resources at each layer, and each layer of R&D resources provides an event function;
[0074] Specifically, in step S120, R&D personnel write independent front-end scripts based on the event mechanism provided by the event protocol to obtain isolated R&D resources at each layer; developers of different levels, industries, partners, and localizations write front-end scripts based on the event mechanism provided by the event protocol. R&D resources at each layer are independent of each other, and each layer of R&D resources realizes product requirements at different levels through these front-end scripts.
[0075] Step S130: preset a configuration file, load the configuration file information, and specify the execution order of the same event function through the configuration file.
[0076] In an embodiment of the present invention, loading configuration file information and determining the script path and loading order include obtaining configuration file information; detecting whether the obtained configuration file information exists; if so, loading the configuration file, the configuration file loads each layer of R&D resource scripts, and arranges the execution order and activation status of each layer of extended event function according to the configuration; if not, loading the horizontal development resource script.
[0077] Specifically, the execution order and activation status of the same event functions of each layer of R&D resources are specified through configuration files, including specifying the default script path and loading order of each layer of R&D resources, specifying the execution order and activation status of page-level event functions registered for each layer of R&D resources, and specifying the execution order and activation status of component-level event functions registered for each layer of R&D resources, so as to achieve maximum code reuse and flexibility.
[0078] For example, if Figure 6 As shown, each layer of R&D resources is set to two layers, namely the industry layer extension script and the local layer extension script. The default loading order is to load the industry layer extension script first, and then load the local layer extension script.
[0079] Step S140: The event functions are classified and assembled into an event function queue according to the execution order specified by the configuration file, completing the resource preprocessing link; Step S150: The event function queue monitors and executes in the corresponding event.
[0080] For example, for a specific page in the product, the static page is customized by the UI template and rendered by component-level events; dynamic interactions such as user operations are responded to by the R&D resources of each layer that have been pre-processed by resources to form a complete page service.
[0081] like Figure 5 As shown, the event function includes a page-level event function and a plurality of component-level event functions located one level below the page-level event function;
[0082] Assemble page-level event functions into a page-level event function queue, which includes: page initialization event function queue, business data loading event function queue, and page destruction event function queue; read the page-level event function queue, and sequentially execute the loading page-level behavior to provide page-level events;
[0083] Assemble component-level event functions into component-level event function queues, which include: button click event function queues, form edit event function queues, and table operation event function queues; component-level event function queues are used for R&D resources at all levels to monitor changes in different component-level events on page-level events.
[0084] The event-based configurable WEB multi-layer extension and hierarchical development method proposed in the present invention writes independent front-end scripts based on the event mechanism provided by a unified event protocol to obtain mutually isolated development resources at each layer. The source codes in the development resources at each layer are isolated from each other. Each layer of development is programmed with a stable event mechanism provided to the outside world for horizontal products. It does not invade the extension of the source code and can achieve smooth version upgrades. The development of each layer can be flexibly reused by modifying a unified configuration file, supporting unlimited levels of extension development. The order of multi-layer extension development can be adjusted to achieve the purpose of product customization. The R&D personnel can maximize code reuse by adjusting the execution order of each layer of R&D resources, which is flexible and efficient.
[0085] Ginseng Figure 2 As shown, the aforementioned determination of the script path and loading order based on the acquired configuration file information at least includes the following steps S11 to S14.
[0086] Step S11, obtaining configuration file information.
[0087] Step S12, detecting whether the acquired configuration file information exists; if so, executing step S13; if not, executing step S14;
[0088] Step S13: If yes, then load the configuration file, the configuration file loads the R&D resource scripts of each layer, and arranges the execution order and activation status of the extended event functions of each layer according to the configuration.
[0089] Step S14: If not, load the horizontal development resource script.
[0090] Specifically, read the configuration file and determine whether the configuration file exists. If the configuration file exists, the horizontal product has been extended and developed, and the configuration file is loaded. If the configuration file does not exist, the horizontal product has not been extended, and the script of the horizontal product is executed.
[0091] Furthermore, when there is a configuration file, the configuration file is loaded, and each layer of R&D resources is loaded according to the order and path of each layer of extended scripts described in the configuration file. Through the configuration file, the R&D personnel can specify the execution order of the same event function of each layer of R&D resources to achieve maximum code reuse and flexibility.
[0092] Specifically, the execution order and activation status of the same event functions provided by each layer of R&D resources are specified based on the configuration file, including specifying the default script path of each layer of R&D resources and configuring the default loading order of each layer of R&D resources;
[0093] like Figure 6 As shown, the R&D resources are set to two layers, namely the industry layer extension script and the local layer extension script. The default loading order is to load the industry layer extension script first, and then load the local layer extension script.
[0094] Specifically, the execution order and activation status of page-level event functions registered by each layer of R&D resources are specified, including obtaining the registration information of each layer of R&D resources; detecting whether each layer of R&D resources has registered the same page-level event function; if each layer of R&D resources has registered the same page-level event function, describing the role and execution order of event functions at different levels, and whether to disable the event function of this layer; if there is no special declaration of the execution order of event functions, the scripts of each layer of R&D resources are loaded according to the default loading order.
[0095] Specifically, based on specifying the execution order and activation status of component-level event functions registered by each layer of R&D resources, it includes obtaining the registration information of each layer of R&D resources; detecting whether each layer of R&D resources has registered the same component-level event function; if each layer of R&D resources registers and listens to the same component-level event function, defining the role and execution order of component-level event functions at each layer, and also disabling the event function of a certain layer; if there is no special declaration of the event function execution order, the scripts of each layer of R&D resources are loaded according to the default loading order.
[0096] Figure 3 and Figure 4 The present invention shows a configurable event-based WEB multi-layer extension hierarchical R&D system 400, including an event protocol module 410, a resource preprocessing module 420, a R&D resource module 430 at each layer, and a resource configuration module 440;
[0097] An event protocol module, configured to provide a unified event protocol;
[0098] The resource configuration module is configured to preset the configuration file and load the configuration file information, and specify the execution order of the same event function through the configuration file;
[0099] Each layer of R&D resource modules is configured to obtain the event mechanism provided by the event protocol to write independent front-end scripts as mutually isolated R&D resources at each layer. Each layer of R&D resources provides event functions.
[0100] The resource preprocessing module is configured to classify and assemble the event functions into an event function queue according to the order specified by the resource configuration file module;
[0101] The assembled event function queue listens and executes in the corresponding events of the event protocol module, and the various layers of R&D resource modules assembled by the resource preprocessing module respond to form a complete page service.
[0102] In the embodiment of the present invention, Figure 5 As shown, the event protocol module 410 includes: a page-level module and a plurality of component-level modules located one level below the page-level module event;
[0103] Page-level modules include:
[0104] The page initialization module, business data loading module, and page destruction module are used to process page-level behaviors such as page initialization, UI template loading, and business data loading, and provide page-level events to the external parties, which are then handed over to the R&D resource modules 430 at each layer for monitoring;
[0105] Component-level modules include:
[0106] The button click membrane hole, form table editing module, and table operation module are used for each layer of R&D resource modules to monitor the changes of different components on the page level module;
[0107] Specifically, the page-level module consists of modules such as page initialization, template or business data loading completion, and page destruction. It is responsible for processing page-level behaviors such as page initialization, UI template loading, and business data loading, and provides page-level events to the outside world, which are handed over to the R&D resource modules 430 at each level for monitoring; the component-level module consists of modules such as button click, form before / after editing, table row selection / row click, query, and tree selection. It provides rich component-level modules and is handed over to R&D resources at each level to monitor changes in different components on the page.
[0108] Specifically, each level of R&D resource modules 430 are independent front-end scripts written by developers of different levels, industries, partners, and localizations based on the event mechanism provided by the event protocol module 410. Each level of R&D uses these front-end scripts to meet product requirements at different levels. Events written in the front-end scripts are all dispatched externally by the event protocol module 410 during different life cycles of interface and component rendering.
[0109] Specifically, a configuration file is provided in the resource configuration module 440. The R&D personnel specify the execution order of the same event function of each layer of R&D resources through the configuration file to achieve maximum code reuse and flexibility. The configuration file is divided into three modules:
[0110] Modules for the script paths and loading order of each layer of R&D resources, the paths of different layers of R&D scripts and the loading order of scripts, (such as Figure 6 As shown, taking a two-layer extension script as an example), for example, two independent layers of R&D resource extension scripts are configured, namely industry and local. By default, industry is executed first and then local, unless the event function execution order of each layer of R&D resource registration page-level module and / or the event function order of each layer of R&D resource registration component-level module has readjusted the event function order for a specific event.
[0111] Furthermore, if each layer of R&D resources registers the same page-level event function, the functions and execution order of the event functions at different levels are described, as well as whether to disable the event function of this layer; if there is no special declaration of the execution order of the event function, the R&D resources at each level are loaded and executed according to the default loading order.
[0112] Furthermore, the event function sequence of the component-level modules registered by each layer of R&D resources defines the role and execution sequence of the component-level event functions of each layer, and can also disable the event functions of a certain layer; if there is no special declaration of the event function execution sequence, the R&D resources of each layer are loaded and executed according to the default loading order.
[0113] See also Figure 7 , a flowchart of the page initialization process of the event-based configurable WEB multi-layer extension layered development method and system provided by the embodiment of the present disclosure.
[0114] For example, Figure 7 As shown, the user operation interface dynamically interacts based on the event protocol module 410, and reads the configuration file of the resource configuration module 440. If there is a configuration file, it means that the horizontal product has been extended and developed, and the configuration file is loaded. If there is no configuration file, it means that the horizontal product has not been extended, and only the script of the horizontal product is executed;
[0115] When there is a configuration file, load the configuration file, and load the extended resource scripts of each layer in the R&D resource module 430 of each layer according to the order and path of the extended scripts of each layer described in the configuration file, and after loading, hand it over to the resource preprocessing module 420 for processing;
[0116] The resource preprocessing module 420 assembles the extended event functions of each layer into an event queue and caches them for use according to the execution order and activation status of the extended event functions of each layer described in the configuration file;
[0117] The page initialization event function queue is read from the cached event queue and executed sequentially. At this point, the page initialization process ends.
[0118] See also Figure 8 The present disclosure also provides an electronic device 50, which includes:
[0119] at least one processor; and,
[0120] a memory communicatively connected to the at least one processor; wherein,
[0121] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the event-based configurable WEB multi-layer extension and hierarchical development method in the aforementioned method embodiment.
[0122] The disclosed embodiment also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the event-based configurable WEB multi-layer extension hierarchical development method in the aforementioned method embodiment.
[0123] The embodiment of the present disclosure also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the event-based configurable WEB multi-layer extension layered development method in the aforementioned method embodiment.
[0124] Reference below Figure 8 , which shows a schematic diagram of the structure of an electronic device 50 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0125] like Figure 8As shown, the electronic device 50 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 50 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0126] Typically, the following devices may be connected to the I / O interface 505: input devices 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 509. The communication device 509 may allow the electronic device 50 to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device 50 with various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
[0127] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0128] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0129] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0130] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains at least two Internet Protocol addresses; sends a node evaluation request including the at least two Internet Protocol addresses to a node evaluation device, wherein the node evaluation device selects an Internet Protocol address from the at least two Internet Protocol addresses and returns it; receives the Internet Protocol address returned by the node evaluation device; wherein the obtained Internet Protocol address indicates an edge node in a content distribution network.
[0131] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: receives a node evaluation request including at least two Internet Protocol addresses; selects an Internet Protocol address from the at least two Internet Protocol addresses; and returns the selected Internet Protocol address; wherein the received Internet Protocol address indicates an edge node in a content distribution network.
[0132] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0133] 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 disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0134] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0135] It should be understood that various parts of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
[0136] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. An event-based configurable WEB multi-layer extension and hierarchical development method, applied to a front-end server, characterized in that: The method comprises the following steps: The front-end server provides a unified event protocol; Obtaining mutually independent front-end scripts written based on the event mechanism provided by the event protocol as mutually isolated R&D resources at each layer, wherein the R&D resources at each layer provide event functions; Preset the configuration file and load the configuration file information, and specify the execution order of the same event function through the configuration file; The event functions are classified and assembled into an event function queue according to the execution order specified by the configuration file to complete the resource preprocessing link; The event function queue monitors and executes in the corresponding events.
2. The event-based configurable WEB multi-layer extension and hierarchical development method according to claim 1 is characterized in that: The loading configuration file information includes: Get configuration file information; Check whether the obtained configuration file information exists; If yes, then load the configuration file, the configuration file loads the R&D resource scripts of each layer, and specifies the execution order and activation status of the same event functions provided by the R&D resources of each layer based on the configuration file; If not, then load the level development resource script.
3. The event-based configurable WEB multi-layer extension and hierarchical development method according to claim 2 is characterized in that: The configuration file-based specification of the execution order and activation status of the same event functions provided by the R&D resources at each layer includes: Specify the default script path for each layer of R&D resources and specify the default loading order for each layer of R&D resources; Specify the execution order and activation status of page-level event functions registered by R&D resources at each level; Specifies the execution order and enabling status of component-level event functions registered by R&D resources at each layer.
4. The event-based configurable WEB multi-layer extension and hierarchical development method according to claim 3 is characterized in that: The execution order and activation status of the page-level event functions registered by the specified R&D resources at each layer include: Obtain registration information of R&D resources at all levels; Check whether each layer of R&D resources has registered the same page-level event function; If the R&D resources at each layer register the same page-level event function, describe the functions and execution order of the event functions at different layers, and whether to disable the event function at this layer; If there is no special declaration of the event function execution order, the R&D resource scripts of each layer will be loaded according to the default loading order.
5. The event-based configurable WEB multi-layer extension and hierarchical development method according to claim 3 is characterized in that: The specified component-level event function execution order and activation status of each layer of R&D resource registration include: Obtain registration information of R&D resources at all levels; Check whether the R&D resources at each layer have registered the same component-level event function; If the R&D resources at each layer register and listen to the same component-level event function, define the role and execution order of the component-level event function at each layer, and you can also disable the event function of a certain layer; If there is no special declaration of the event function execution order, the R&D resource scripts of each layer will be loaded according to the default loading order.
6. The event-based configurable WEB multi-layer extension and hierarchical development method according to claim 1, characterized in that: The event function includes: a page-level event function and a plurality of component-level event functions located at a level below the page-level event function; Assembling the page-level event functions into a page-level event function queue, wherein the page-level event function queue includes: a page initialization event function queue, a business data loading event function queue, and a page destruction event function queue; reading the page-level event function queue, and sequentially executing the loading page-level behavior to provide page-level events; The component-level event functions are assembled into a component-level event function queue, which includes: a button click event function queue, a form table editing event function queue, and a table operation event function queue; the component-level event function queue is used for the R&D resources at each layer to monitor changes in different component-level events on the page-level events.
7. An event-based configurable WEB multi-layer extension and hierarchical R&D system, characterized in that: The system comprises: An event protocol module, configured to provide a unified event protocol; Each layer of R&D resource modules is configured to obtain an event mechanism provided by the event protocol to write independent front-end scripts as mutually isolated R&D resources at each layer, and the R&D resources at each layer provide event functions; The resource configuration module is configured to preset the configuration file and load the configuration file information, and specify the execution order of the same event function through the configuration file; The resource preprocessing module is configured to classify and assemble the event functions into an event function queue according to the order specified by the resource configuration file module; The event protocol module is also configured to monitor and execute the event function queue in the corresponding event.
8. An electronic device, characterized in that: The electronic device includes: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor executes the event-based configurable WEB multi-layer extension and hierarchical development method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed by at least one processor, cause the at least one processor to execute the event-based configurable WEB multi-layer extension hierarchical development method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of the event-based configurable WEB multi-layer extension and hierarchical development method according to any one of claims 1 to 6.