Page function configuration methods, electronic devices and energy management platforms
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-20
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]有鉴于此,本申请实施例提供了一种页面功能配置方法、电子设备及能源管理平台,以解决相关技术中页面新增功能的开发方式效率低、周期长,难以适应高频率功能变更的应用场景,还会造成开发资源的重复投入的技术问题
[0023] It is understood that the beneficial effects of aspects two through eight above can be found in the relevant descriptions in aspect one above, and will not be repeated here.
Smart Images

Figure CN122569915A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of page configuration technology, specifically to a page function configuration method, electronic device, and energy management platform. Background Technology
[0002] In current web engineering project deployment practices, a secondary development model based on existing pages and configuration modifications is common. In this model, the development and deployment of incremental features usually cannot be completed independently and must rely on the existing pages.
[0003] For example, when adding new functions such as data monitoring and energy consumption statistics to the existing pages of an energy management platform, the code of the existing pages must be modified and developed and deployed along with the entire web project containing the existing pages. This approach is inefficient, time-consuming, and difficult to adapt to application scenarios with high frequency of function changes. It also results in the duplication of development resources. Summary of the Invention
[0004] In view of this, embodiments of this application provide a page function configuration method, an electronic device, and an energy management platform to solve the technical problems in the related technologies where the development of new page functions is inefficient, has a long cycle, is difficult to adapt to application scenarios with high frequency of function changes, and also causes repeated investment of development resources.
[0005] In a first aspect, embodiments of this application provide a page function configuration method, applied to an electronic device, the method comprising: Obtain the source code corresponding to the target function to be added to the target page; the target page is a page in the energy management platform, and the source code is decoupled from the original code of the target page; The source code is processed to obtain module files that can be recognized by the energy management platform, and runtime dependency files are obtained based on the source code; The module files and runtime dependency files are integrated to obtain a resource package for independent operation; The resource package is sent to the energy management platform so that when the energy management platform receives the resource package and receives an access instruction for the target page, it renders and generates a target page that integrates the target function based on the resource package.
[0006] In one possible implementation of the first aspect, the processing of the source code to obtain module files recognizable by the energy management platform, and the generation of runtime dependency files based on the source code, includes: The source code is compiled and packaged to obtain module files that can be recognized by the energy management platform; Identify the development framework to which the source code belongs, and determine the runtime dependency files based on the development framework.
[0007] In one possible implementation of the first aspect, prior to integrating the module file and the runtime dependency file, the method further includes: Obtain the configuration information and static resources of the source code; the configuration information is used to describe the attributes, functions, and associated pages of the source code; Accordingly, the integration of the module file and the runtime dependency file to obtain a resource package for independent operation includes: The module file, the runtime dependency file, the configuration information, and the static resources are integrated to obtain a resource package for independent operation.
[0008] In one possible implementation of the first aspect, the target page includes a business page and a configuration page.
[0009] Secondly, embodiments of this application provide a page function configuration method applied to an energy management platform, the method comprising: Receive resource packages sent by electronic devices; the resource packages correspond to target pages and target functions, and integrate module files and runtime dependency files that can be recognized by the energy management platform; Upon receiving an access instruction for the target page, the system renders and generates a target page that integrates the target functionality based on the resource package.
[0010] In one possible implementation of the second aspect, the resource package also integrates static resources; Following the resource packet sent by the receiving electronic device, the following is also included: In response to the user's editing operation on the static resource, the edited resource package is obtained; The edited resource package will be used as the resource package.
[0011] In one possible implementation of the second aspect, rendering and generating a target page integrating the target functionality based on the resource package includes: Load and run the resource package; Based on the loaded and running resource package, render and generate a target page that integrates the target functionality.
[0012] In one possible implementation of the second aspect, loading and running the resource package, and rendering and generating a target page integrating the target functionality based on the loaded and run resource package, includes: Based on the target page, determine the corresponding runtime container; Identify the development framework corresponding to the resource package, and determine the corresponding rendering method based on the development framework; The resource package is loaded and run within the runtime container, and based on the loaded and run resource package, a target page integrating the target function is rendered and generated according to the rendering method.
[0013] Thirdly, embodiments of this application provide a page function configuration device, including: The acquisition module is used to acquire the source code corresponding to the target function to be added to the target page; the target page is a page in the energy management platform, and the source code is decoupled from the original code of the target page.
[0014] The processing module is used to process the source code to obtain module files that can be recognized by the energy management platform, and to obtain runtime dependency files based on the source code.
[0015] An integration module is used to integrate the module files and the runtime dependency files to obtain a resource package for independent operation.
[0016] The sending module is used to send the resource package to the energy management platform, so that after the energy management platform receives the resource package and receives an access instruction for the target page, it renders and generates a target page integrating the target function based on the resource package.
[0017] Fourthly, embodiments of this application provide a page function configuration device, including: The receiving module is used to receive resource packages sent by electronic devices; the resource packages correspond to target pages and target functions, and integrate module files and runtime dependency files that can be recognized by the energy management platform.
[0018] The rendering module is used to render and generate a target page integrating the target function based on the resource package when an access instruction for the target page is received.
[0019] Fifthly, embodiments of this application provide an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor, and when the processor executes the computer program, it implements the page function configuration method as described in any of the first aspects.
[0020] In a sixth aspect, embodiments of this application provide an energy management platform, including a memory and a processor. The memory stores a computer program that can run on the processor, and when the processor executes the computer program, it implements the page function configuration method as described in any of the second aspects.
[0021] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the page function configuration method as described in any of the first aspects.
[0022] Eighthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the page function configuration method as described in any of the second aspects.
[0023] It is understood that the beneficial effects of aspects two through eight above can be found in the relevant descriptions in aspect one above, and will not be repeated here.
[0024] The page function configuration method, electronic device, and energy management platform provided in this application embodiment involve the electronic device acquiring the source code corresponding to the target function to be added to the target page. The target page is a page in the energy management platform, and the source code is decoupled from the original code of the target page. Then, the source code is processed to obtain a module file that can be recognized by the energy management platform. Based on the source code, runtime dependency files are obtained, and the module files and runtime dependency files are integrated to obtain a resource package for independent operation. The resource package is sent to the energy management platform. After receiving the resource package, the energy management platform, upon receiving an access instruction for the target page, renders and generates a target page integrating the target function based on the resource package.
[0025] In this way, since the source code of the target function is decoupled from the original code of the target page and does not interfere with each other, the resource package integrates module files and runtime dependency files that can run independently. When adding a new target function, there is no need to modify the original code of the target page. This enables the independent development and deployment of the target function, shortens the development cycle, improves the efficiency of function iteration and launch, and can adapt to application scenarios with high frequency of function changes. At the same time, the same function can directly reuse the same resource package, effectively improving the resource package reuse rate and reducing the duplication of development resources.
[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1This is a schematic diagram of an application scenario provided by an embodiment of this application; Figure 2 This is a flowchart illustrating a page function configuration method provided in an embodiment of this application; Figure 3 This is a flowchart illustrating a page function configuration method provided in another embodiment of this application; Figure 4 This is a schematic diagram of the structure of a page function configuration device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a page function configuration device provided in another embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an energy management platform provided in an embodiment of this application. Detailed Implementation
[0029] The present application will be described more clearly below with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the function of the present application, but do not limit the present application in any way. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application. These all fall within the protection scope of the present application.
[0030] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0031] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0032] In the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0033] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0034] Furthermore, the term "multiple" mentioned in the embodiments of this application should be interpreted as two or more.
[0035] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application. The application scenario involves electronic devices and an energy management platform, wherein the target page in the energy management platform is an existing page, and a new target function is to be added.
[0036] The electronic device acquires the source code corresponding to the target function. This source code is decoupled from and does not interfere with the original code of the target page. The source code is then processed to obtain an independently executable resource package, which is sent to the energy management platform. The energy management platform receives the resource package and, upon receiving an access command for the target page, renders and generates a target page integrating the target function based on the resource package, thus configuring the page's functionality.
[0037] Figure 2 This is a flowchart illustrating a page function configuration method provided in an embodiment of this application. Figure 2 As shown, the method in this application embodiment is applied to an electronic device, and the method may include: S201. Obtain the source code corresponding to the target function to be added to the target page; the target page is a page in the energy management platform, and the source code is decoupled from the original code of the target page.
[0038] For example, the target page is an existing page in an energy management platform that needs to be expanded with new functions, such as a data display page within the platform, where a new energy consumption statistics function is to be added. The source code corresponding to the target function is the functional code written by technical personnel for the target function, and the source code is decoupled from the original code of the target page and does not interfere with each other. In this way, the new target function can be developed independently without modifying the original code of the target page.
[0039] In some embodiments, the target page includes a business page and a configuration page. The business page is mainly for platform users and is used for data display and business function usage, while the configuration page is mainly for platform operation and maintenance personnel and is used for parameter setting and resource editing and maintenance.
[0040] S202. Process the source code to obtain module files that can be recognized by the energy management platform, and obtain runtime dependency files based on the source code.
[0041] In some embodiments, when the module file and runtime dependency file are obtained, the source code can be compiled and packaged to obtain a module file that can be recognized by the energy management platform, as well as to identify the development framework to which the source code belongs, and to determine the runtime dependency file based on the development framework.
[0042] Since the source code is in development state and cannot be run directly on the energy management platform, the source code is translated, merged and packaged. That is, through compilation and packaging, the source code is converted into standardized, uniformly formatted module files that can be recognized by the platform.
[0043] The development framework to which the source code belongs refers to the technical framework used in its development, such as different front-end development frameworks like Vue 2, Vue 3, and React. Different development frameworks require different basic environments, basic components, and underlying support libraries to run. Therefore, after determining the type of development framework to which the source code belongs, the necessary environment resources, basic dependency libraries, and runtime support components are retrieved from pre-defined libraries and combined to form a matching runtime dependency file. This provides the essential runtime environment support for the normal startup and logic execution of subsequent module files.
[0044] Optionally, this embodiment can identify the development framework to which the source code belongs by parsing the source code's syntax, component structure, instruction specifications, function syntax, etc.
[0045] S203. Integrate the module files and runtime dependency files to obtain a resource package for independent operation.
[0046] In some embodiments, configuration information and static resources of the source code can be obtained before integrating module files and runtime dependency files. Accordingly, the module files, runtime dependency files, configuration information, and static resources are integrated to obtain a resource package for independent operation.
[0047] When technicians write source code for a target function, they can also set corresponding configuration information and static resources. Therefore, in this embodiment, when obtaining the source code corresponding to the target function, both the configuration information and static resources of the source code can be obtained simultaneously.
[0048] The configuration information describes the attributes, functions, and associated pages of the source code. For example, it includes the source code's name, function description, required parameters, frame type, and associated page identifiers. Static resources include style files, icons, images, fonts, and other visual display materials required for the target function's complete rendering and display.
[0049] The module files, runtime dependency files, configuration information, and static resources are integrated and packaged into a resource package. Because this resource package integrates the main program, supporting runtime environment, and page display resources required for the function to run, it possesses all the elements necessary for complete operation and can therefore run independently.
[0050] Optionally, the configuration information includes the framework type to which the source code belongs. In this embodiment, the development framework to which the source code belongs can also be determined based on the configuration information, and then the runtime dependency files can be determined based on the development framework.
[0051] In this embodiment, the source code of the target function is decoupled from the original code of the target page. Adding a new target function does not require modifying the original code of the target page, enabling independent development and deployment of the target function. This effectively overcomes the shortcomings of related technologies where even adding a minor function requires modifying the entire page's code and repeating the entire page development process. This shortens the development cycle, improves function iteration and deployment efficiency, and thus adapts to application scenarios with high-frequency function changes, enhancing development efficiency and business agility. Simultaneously, it effectively reduces the platform instability risk and maintenance manpower requirements caused by frequent full deployments of new functions on the platform, as seen in related technologies.
[0052] Since the target functions can be developed and deployed independently, and the corresponding resource packages can run independently, the same functions can directly reuse the same resource package, which effectively improves the resource package reuse rate, reduces homogeneous development work, reduces the cost of repeated development, and avoids the problem of similar functions not being effectively reused and homogeneous functions being repeatedly developed in related technologies.
[0053] Furthermore, when a target page corresponds to multiple new target functions, the energy management platform may have requirements for arbitrarily combining different functions. The forms of function combinations are complex and diverse, and the number of combinations grows exponentially. The development methods in related technologies are difficult to adapt to all combination scenarios, leading to a combination explosion problem. In this embodiment, the resource packages corresponding to the target functions can run independently. When there are multiple resource packages, they are decoupled, allowing the platform to flexibly select the necessary resource packages to mount to the target page according to actual usage needs, without having to develop separate page code for each function combination. This fundamentally avoids the combination explosion problem caused by the surge in the number of function combinations.
[0054] S204. Send the resource package to the energy management platform so that after receiving the resource package, the energy management platform, upon receiving an access instruction for the target page, renders and generates a target page integrating the target function based on the resource package.
[0055] For example, in this embodiment, the obtained resource package for independent operation is sent to the energy management platform. Specifically, the resource package can be compressed, and then the compressed resource package is sent to the platform to improve the data transmission efficiency between the electronic device and the energy management platform.
[0056] After receiving the resource package, the energy management platform stores and manages it. For example, the platform first decompresses and stores the compressed resource package, then parses it and associates it with the target page based on the identifier of the associated page in the configuration information, which is the identifier of the target page. This facilitates subsequent function mounting, calling and starting of the target page.
[0057] Afterwards, the energy management platform can also respond to the user's editing operations on the static resources in the resource package, obtain the edited resource package, and use the edited resource package as the resource package.
[0058] Optionally, the energy management platform can display an operation interface where users (referring to platform operation and maintenance personnel) can edit static resources in the resource package. For example, users can replace images or modify font styles in static resources. The platform responds to the user's editing operations on the static resources in the resource package and obtains the edited resource package.
[0059] Of course, users can also delete resource packages through the operation interface. The platform will respond to the user's deletion operation through the operation interface and delete the resource package.
[0060] When the energy management platform receives an access instruction for the target page and generates a target page that integrates the target functions, it can also load and run a resource package, and render and generate the target page that integrates the target functions based on the loaded and run resource package.
[0061] In some embodiments, the energy management platform can determine the corresponding runtime container and identify the development framework corresponding to the resource package based on the target page, and determine the corresponding rendering method based on the aforementioned development framework. Then, the resource package is loaded and run in the runtime container, and based on the loaded and run resource package, the target page integrating the target function is rendered and generated according to the aforementioned rendering method.
[0062] The platform determines the runtime container corresponding to the target page. For example, the runtime container for the target page may have already been matched with the target page during its development, and the platform directly determines the corresponding runtime container based on the target page. The platform identifies the development framework corresponding to the resource package by parsing the compilation identifiers and runtime characteristics of the module files in the resource package, or by determining the development framework corresponding to the resource package based on the configuration information in the resource package, and then matches the appropriate rendering method based on the aforementioned development framework. For example, the Vue 2 framework matches the Vue 2 renderer, and the React framework matches the React renderer.
[0063] The platform loads the resource package into the runtime container, completing the loading and running of the resource package. Then, based on the loaded and running resource package, it calls the rendering method that matches the resource package to render and generate the target page that integrates the target function, thus realizing the configuration of the target page's target function.
[0064] It's important to note that in real-world scenarios, a target page can correspond to multiple resource packages. When generating a target page integrating the target functionality, the platform determines the appropriate development framework and rendering method for each resource package. This involves loading and running each resource package within the runtime container, and for each loaded and running resource package, invoking the corresponding rendering method to ultimately render and generate the target page integrating the target functionality.
[0065] Furthermore, considering that the energy management platform needs to operate stably for a long time and cannot frequently upgrade the underlying framework version—for example, the energy management platform itself is usually built on a specific version of a front-end framework (such as Vue 2.x) and has already loaded a large number of global dependencies; while the technology stack of external functional modules for new features iterates faster. For example, independently developed resource packages may be developed based on different versions or different frameworks (such as Vue 3.x, React 18.x), and their runtime environments may conflict with the platform's main environment. For instance, if the platform has a globally registered Vue 2 reactive system, when the resource package loads a Vue 3 renderer, the two will pollute global variables and compete for the DOM update mechanism, leading to blank screens or functional abnormalities, making the conflict unavoidable.
[0066] To this end, in some embodiments, the energy management platform can allocate an independent sandboxed runtime container for each resource package. This sandboxed runtime container is isolated from the execution environment of the original code of the target page at the global object, stylesheet, and dependency library levels. When rendering and generating a target page integrating the target functionality based on the resource package, a copy of the specific version of the dependency can be dynamically obtained from the platform's isolated dependency repository according to the different frameworks on which each resource package is based, and loaded separately within the sandboxed runtime container to avoid conflicts with the platform's global dependencies. For example, in a specific development case, the main framework of the energy management platform is developed using Vue 2.6. When a resource package for an energy consumption chart developed based on React 18 is received, the platform first parses its configuration information and finds that it depends on react@18.2.0 and react-dom@18.2.0. Since the main framework has no React dependencies, and to avoid conflicts with the React versions of other resource packages in the future, the platform dynamically creates a hidden dependency. <iframe>As a sandboxed runtime container, `sandbox="allow-same-origin allow-scripts allow-popups allow-forms allow-modals"` is set (allowing them to be enabled as needed). Inside the iframe, `import-map` maps react and react-dom to specific version files in an isolated dependency repository within the platform. All scripts in the resource package execute within this iframe and do not affect external pages. The main frame and the resource package communicate only to a limited extent via `postMessage`. The resource package cannot directly access the main frame's global variables or initiate cross-origin requests, thus ensuring the security of the energy management system itself.
[0067] As mentioned above, when a target page corresponds to multiple target functions to be added, the energy management platform may have the need to combine different functions in any way. However, the combination of functions is complex and diverse, and the number of combinations grows exponentially. In this embodiment, the resource package corresponding to the target function can run independently. When there are multiple resource packages, each resource package is decoupled. Therefore, users can combine resource packages as needed in the platform's operation interface. The platform responds to the user's operation on the operation interface to combine each resource package and mounts the combined resource packages to the target page, realizing online combination configuration of functions. This eliminates the need to develop page code separately for each function combination, effectively solving the problem that the development method in related technologies is difficult to adapt to all combination scenarios one by one, and fundamentally avoiding the combination explosion problem caused by the surge in the number of function combinations.
[0068] The page function configuration method provided in this application embodiment involves an electronic device obtaining the source code corresponding to the target function to be added to the target page. The target page is a page in the energy management platform. The source code is decoupled from the original code of the target page. Then, the source code is processed to obtain a module file that can be recognized by the energy management platform. Based on the source code, runtime dependency files are obtained. The module files and runtime dependency files are integrated to obtain a resource package for independent operation. The resource package is sent to the energy management platform. After receiving the resource package, the energy management platform renders and generates a target page with integrated target function based on the resource package when it receives an access instruction for the target page.
[0069] In this way, since the source code of the target function is decoupled from the original code of the target page and does not interfere with each other, the resource package integrating module files and runtime dependency files can run independently. When adding a new target function, there is no need to modify the original code of the target page, enabling independent development and deployment of the target function, shortening the development cycle, improving the efficiency of function iteration and online release, and thus adapting to application scenarios with high-frequency function changes. At the same time, the same function can directly reuse the same resource package, effectively improving the reuse rate of the resource package and reducing the repeated investment in development resources.
[0070] Figure 3 is a schematic flowchart of a page function configuration method provided by another embodiment of the present application. As shown in
[0070] Figure 3, the method in the embodiment of the present application is applied to an energy management platform, and the above method may include:S301. Receive a resource package sent by an electronic device; the resource package corresponds to a target page and a target function, and integrates module files and runtime dependency files that can be recognized by the energy management platform.
[0071] S302. When receiving an access instruction to the target page, render and generate a target page integrated with the target function based on the resource package.
[0072] Among them, the target page is a page in the energy management platform, such as a business page and a configuration page. The resource package can run independently and also integrates configuration information and static resources. The configuration information is used to describe the attributes, functions, and associated pages of the source code. The static resources include visual display materials such as style files, icons, pictures, and fonts required for the display of the target function, and are used to support the complete rendering and display of the target function.
[0073] In some embodiments, after receiving the resource package sent by the electronic device, it is also possible to respond to the user's editing operation on the static resources, obtain an edited resource package, and use the edited resource package as the resource package.
[0074] In some embodiments, when rendering and generating a target page integrated with the target function based on the resource package, the resource package can be loaded and run, and based on the loaded and run resource package, a target page integrated with the target function is rendered and generated.
[0075] Optionally, based on the target page, the corresponding running container can be determined, and the development framework corresponding to the resource package can be identified. Then, based on the above development framework, the corresponding rendering method can be determined. After that, the resource package is loaded and run in the running container, and based on the loaded and run resource package, the target page integrated with the target function is rendered and generated according to the rendering method.
[0076] The specific implementation processes and principles of S301 to S302 in this embodiment can be referred to the foregoing embodiments, and will not be elaborated here.
[0077] It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.
[0078] Figure 4 is a schematic structural diagram of a page function configuration device provided by an embodiment of this application. As shown in Figure 4, the page function configuration device provided in this embodiment may include: an acquisition module 401, a processing module 402, an integration module 403, and a sending module 404.
[0079] Among them, the acquisition module 401 is used to acquire the source code corresponding to the target function to be newly added to the target page; the target page is a page in the energy management platform, and the source code is decoupled from the original code of the target page.
[0080] The processing module 402 is used to process the source code to obtain a module file recognizable by the energy management platform, and obtain a runtime dependency file based on the source code.
[0081] The integration module 403 is used to integrate the module file and the runtime dependency file to obtain a resource package for independent operation.
[0082] The sending module 404 is used to send the resource package to the energy management platform, so that after the energy management platform receives the resource package, when receiving an access instruction to the target page, it renders and generates a target page integrated with the target function based on the resource package.
[0083] Optionally, the processing module 402 is further configured to:Compile and package the source code to obtain a module file recognizable by the energy management platform;Identify the development framework to which the source code belongs, and determine runtime dependency files based on the development framework.
[0084] Optionally, the integration module 403 is further configured to:Obtain the configuration information and static resources of the source code; the configuration information is used to describe the attributes, functions, and associated pages of the source code;And integrate the module file, the runtime dependency files, the configuration information, and the static resources to obtain a resource package for independent operation.
[0085] Figure 5 is a schematic structural diagram of a page function configuration device provided in another embodiment of the present application. As shown in Figure 5, the page function configuration device provided in this embodiment may include: a receiving module 501 and a rendering module 502.
[0086] Among them, the receiving module 501 is configured to receive a resource package sent by an electronic device; the resource package corresponds to a target page and a target function, and integrates a module file and runtime dependency files recognizable by the energy management platform.
[0087] The rendering module 502 is configured to, when receiving an access instruction to the target page, render and generate a target page integrated with the target function based on the resource package.
[0088] Optionally, the resource package further integrates static resources; the rendering module 502 is further configured to:Respond to an editing operation of the user on the static resources to obtain an edited resource package;Use the edited resource package as the resource package.
[0089] Optionally, the rendering module 502 is further configured to:Load and run the resource package;Render and generate a target page integrated with the target function based on the loaded and run resource package.
[0090] Optionally, the rendering module 502 is further configured to: determine a corresponding running container based on the target page; identify the development framework corresponding to the resource package, and determine a corresponding rendering method based on the development framework; load and run the resource package in the running container, and render and generate a target page integrated with the target function according to the rendering method based on the loaded and running resource package.
[0091] It should be noted that for the information interaction, execution process, etc. between the above-mentioned device / units, since they are based on the same concept as the method embodiments of this application, for their specific functions and the technical effects brought, please refer to the method embodiment part for details, and will not be elaborated here.
[0092] Figure 6 is a schematic structural diagram of an electronic device provided by an embodiment of this application. As shown in Figure 6, the electronic device 600 in this embodiment includes: a processor 610 and a memory 620. A computer program 621 that can run on the processor 610 is stored in the memory 620. When the processor 610 executes the computer program 621, the steps in any of the above method embodiments are implemented, such as S201 to S204 shown in Figure 2. Alternatively, when the processor 610 executes the computer program 621, the functions of each module / unit in the above device embodiments are implemented, such as the functions of modules 401 to 404 shown in Figure 4.
[0093] Figure 7 is a schematic structural diagram of an energy management platform provided by an embodiment of this application.As shown in Figure 7, the energy management platform 700 of this embodiment includes: a processor 710 and a memory 720. A computer program 721 that can run on the processor 710 is stored in the memory 720. When the processor 710 executes the computer program 721, it implements the steps in any of the above method embodiments, such as S301 to S302 shown in Figure 3. Alternatively, when the processor 710 executes the computer program 721, it implements the functions of each module / unit in the above device embodiments, such as the functions of modules 501 to 502 shown in Figure 5.
[0094] Exemplarily, the computer program can be divided into one or more modules / units. One or more modules / units are stored in the memory and executed by the processor to complete this application. The one or more modules / units can be a series of computer program instruction segments that can complete specific functions, and these instruction segments are used to describe the execution process of the computer program in the platform or device.
[0095] Those skilled in the art can understand that Figure 6 and Figure 7 are only examples of electronic devices and energy management platforms, and do not constitute limitations on the platform or device. It can include more or fewer components than shown in the figures, or combine some components, or different components, such as input and output devices, network access devices, buses, etc.
[0096] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0097] The memory can be an internal storage unit of the platform or device, such as a hard drive or memory of the platform or device, or it can be an external storage device of the platform or device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc. The aforementioned memory can also include both internal storage units and external storage devices of the platform or device. The aforementioned memory is used to store computer programs and other programs and data required by the platform or device. The memory can also be used to temporarily store data that has been output or will be output.
[0098] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0099] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0100] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the invention.
[0101] In the embodiments provided by the present invention, it should be understood that the disclosed apparatus / platform / device and method can be implemented in other ways. For example, the apparatus / platform / device embodiments described above are merely illustrative. For example, the division of modules or units is merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0102] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0103] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0104] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form, etc.The computer-readable medium may include any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0105] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.< / iframe>
Claims
1. A method for configuring page functions, characterized in that, Applied to electronic devices, the method includes: Obtain the source code corresponding to the target function to be added to the target page; the target page is a page in the energy management platform, and the source code is decoupled from the original code of the target page; The source code is processed to obtain module files that can be recognized by the energy management platform, and runtime dependency files are obtained based on the source code; The module files and runtime dependency files are integrated to obtain a resource package for independent operation; The resource package is sent to the energy management platform so that when the energy management platform receives the resource package and receives an access instruction for the target page, it renders and generates a target page that integrates the target function based on the resource package.
2. The page function configuration method according to claim 1, characterized in that, The source code is processed to obtain module files that can be recognized by the energy management platform, and runtime dependency files are obtained based on the source code, including: The source code is compiled and packaged to obtain module files that can be recognized by the energy management platform; Identify the development framework to which the source code belongs, and determine the runtime dependency files based on the development framework.
3. The page function configuration method according to claim 1, characterized in that, Before integrating the module file and the runtime dependency file, the method further includes: Obtain the configuration information and static resources of the source code; the configuration information is used to describe the attributes, functions, and associated pages of the source code; Accordingly, the integration of the module file and the runtime dependency file to obtain a resource package for independent operation includes: The module file, the runtime dependency file, the configuration information, and the static resources are integrated to obtain a resource package for independent operation.
4. The page function configuration method according to any one of claims 1 to 3, characterized in that, The target pages include business pages and configuration pages.
5. A method for configuring page functions, characterized in that, Applied to an energy management platform, the method includes: Receive resource packages sent by electronic devices; the resource packages correspond to target pages and target functions, and integrate module files and runtime dependency files that can be recognized by the energy management platform; Upon receiving an access instruction for the target page, the system renders and generates a target page that integrates the target functionality based on the resource package.
6. The page function configuration method according to claim 5, characterized in that, The resource package also includes static resources; Following the resource packet sent by the receiving electronic device, the following is also included: In response to the user's editing operation on the static resource, the edited resource package is obtained; Use the edited resource package as the resource package.
7. The page function configuration method according to claim 5, characterized in that, The process of rendering and generating a target page integrating the target function based on the resource package includes: Load and run the resource package; Based on the loaded and running resource package, render and generate a target page that integrates the target functionality.
8. The page function configuration method according to claim 7, characterized in that, The process of loading and running the resource package, and rendering and generating a target page integrating the target functionality based on the loaded and run resource package, includes: Based on the target page, determine the corresponding runtime container; Identify the development framework corresponding to the resource package, and determine the corresponding rendering method based on the development framework; The resource package is loaded and run within the runtime container, and based on the loaded and run resource package, a target page integrating the target function is rendered and generated according to the rendering method.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the page function configuration method as described in any one of claims 1 to 4.
10. An energy management platform, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the page function configuration method as described in any one of claims 5 to 8.