A method and apparatus for generating a custom plug-in
By providing customers with a plugin generation standard, clients can write plugin code and generate personalized plugins, solving the problem of meeting the needs of niche customers, reducing software maintenance and development costs, and expanding the application scope of the software.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QI AN XIN TECHNOLOGY GROUP INC
- Filing Date
- 2022-12-19
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies are unable to effectively meet the personalized needs of niche customers, resulting in high costs for secondary development and difficulties in maintenance, which affects the software's adoption rate.
It provides plugin generation standards, allowing clients to write plugin code according to preset rules. Personalized plugins are generated through parsing and integration, reducing the need for secondary development by software providers.
It enables the generation of customer-customized plugins, reduces software maintenance and secondary development costs, and expands the software's audience.
Smart Images

Figure CN115951865B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software development technology, and in particular to a method and apparatus for generating custom plugins. Background Technology
[0002] As application software becomes more diversified, it offers users an increasing number of functions. Users also have their own needs and habits during application, leading to different user requirements. To meet these personalized needs, software providers can release different versions of the software based on the needs of different customers, but this often fails to satisfy the needs of niche customers.
[0003] Currently, for niche clients with personalized needs, the typical approach is for clients to specify their requirements, and then the software provider to customize the software accordingly. However, this method requires clients to have clearly defined needs and to pay high secondary development fees. Furthermore, this secondary development approach only addresses the client's current needs. As technology advances, client needs will inevitably change, leading to high usage costs for clients who want to use the software according to their specific requirements due to continuously evolving secondary development needs. Summary of the Invention
[0004] In view of the above problems, the present invention proposes a method and apparatus for generating custom plugins. The main purpose is to provide customers with a custom plugin creation service by providing plugin generation standards, so that customers can develop customized plugins according to their own needs.
[0005] To achieve the above objectives, the present invention mainly provides the following technical solutions:
[0006] In a first aspect, the present invention provides a method for generating custom plugins, the method comprising:
[0007] Obtain the plugin code written by the client according to preset rules. The plugin code has a container composed of multiple related components, wherein each related component is used to implement the basic operation of the software.
[0008] The container in the plugin code is parsed, and the execution order of multiple related components in the same container is determined;
[0009] The parsing results of each container are determined based on the execution order;
[0010] Based on the parsing results and the client's plugin environment, a front-end plugin corresponding to the plugin code is generated.
[0011] Secondly, the present invention provides a custom plugin generation apparatus, the apparatus comprising:
[0012] The acquisition unit is used to acquire the plugin code written by the client according to preset rules. The plugin code has a container composed of multiple related components, wherein each related component is used to implement the basic operation of the software.
[0013] The parsing unit is used to parse the container in the plugin code obtained by the acquisition unit and determine the execution order of multiple related components in the same container;
[0014] An integration unit is used to determine the parsing results of each container based on the execution order obtained by the parsing unit;
[0015] The generation unit is used to generate the front-end plugin corresponding to the plugin code based on the parsing result obtained by the integration unit and the plugin environment of the client.
[0016] On the other hand, the present invention also provides a processor for running a program, wherein the program executes the above-described method for generating custom plugins during runtime.
[0017] On the other hand, the present invention also provides a storage medium for storing a computer program, wherein the computer program, when running, controls the device where the storage medium is located to execute the above-described method for generating a custom plugin.
[0018] By employing the above technical solution, the present invention provides a method and apparatus for generating custom plugins. When providing software products to customers, application software providers simultaneously offer preset rules for configuring plugins within the software product. Customers then write plugin code according to these preset rules based on their own needs. The software product also includes a corresponding parsing engine to process the plugin code, parsing it according to the preset rules to generate plugins corresponding to the functions required by the customer. These plugins are then encapsulated into executable front-end plugins within the client's plugin environment, facilitating customer application on the client side. Thus, this invention achieves personalized plugin configuration by providing customers with a set of plugin configuration standards. Customers can customize their required plugins based on these standards and generate executable front-end plugins on their local client by uploading plugin code. In this way, the development process is completely delegated to the customer. For the software provider, only the preset rules for configuring plugins need to be defined and maintained, eliminating the need for repeated secondary development based on user needs, significantly reducing application software maintenance costs. For the customer, the ability to freely define plugins based on preset rules also saves on high secondary development costs.
[0019] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0020] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0021] Figure 1 A flowchart of a method for generating a custom plugin according to an embodiment of the present invention is shown;
[0022] Figure 2 A flowchart of another method for generating custom plugins according to an embodiment of the present invention is shown;
[0023] Figure 3 A schematic diagram of a custom plugin generation device according to an embodiment of the present invention is shown.
[0024] Figure 4 A schematic diagram of another custom plugin generation device proposed in an embodiment of the present invention is shown. Detailed Implementation
[0025] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
[0026] A plugin is a program written according to a specific application programming interface (API) specification. It can only run on the system platform specified by the program and cannot run independently of the designated platform. Plugins help users use software more conveniently; for example, browser plugins can help users browse websites or access internet assistance functions more easily. Therefore, good plugins can help users use software more efficiently. However, different users have diverse needs for application software. This leads software providers to consider the needs of the majority of users when providing plugins. For the needs of niche users, considering development costs and other issues, these niche users generally need to solve the problems themselves, i.e., custom development, transferring the development costs to the customer. However, in today's increasingly competitive environment, this approach undoubtedly reduces the application software's audience, thus affecting its adoption rate.
[0027] To address this, the inventors of this case propose a novel plugin generation method. The main idea of this method is to delegate the plugin development process to users. Software providers offer plugin development standards, allowing users to customize and configure the plugins according to their own needs within these standards. This way, all users can have their own custom plugins. The specific steps of the custom plugin generation method in this embodiment are as follows: Figure 1 As shown, it includes:
[0028] 101. Obtain the plugin code written by the client according to preset rules.
[0029] In this context, "client" refers to the application software on the user's side. A single user can use multiple clients when using the same software. For example, WeChat can be a mobile client (Android or iOS version) or a PC client (Windows version). Therefore, different clients have different preset rules.
[0030] In this embodiment, the preset rules are defined by the software provider, and users can write their own plugin code according to these preset rules in the software client. To make it easier for users to write plugin code and lower the barrier to entry, the preset rules in this step configure basic components for operating the software. These components are the basic operations for operating the software, and more complex operation steps can be achieved by combining these components in different ways, thereby realizing certain required functions. Therefore, when writing plugin code, users directly call these components for combination. The specific combination method also needs to be defined according to the preset rules.
[0031] In this embodiment, the code corresponding to an operation or function composed of a combination of components is defined as a container. The plugin code written by the user is composed of one or more containers. Since multiple components within a container have certain inter-component dependencies, these components are defined as associated components in this embodiment. Generally, multiple components in a container can be associated components, independent components, or multiple independent groups of associated components.
[0032] 102. Analyze the containers in the plugin code and determine the execution order of multiple related components in the same container.
[0033] Step 101 has already introduced the writing method of plugin code and the content of preset rules. Therefore, it can be seen that plugin code contains containers composed of components. When parsing plugin code, the first step is to identify which containers are present within the plugin code and then parse each container separately.
[0034] When parsing a container, since the container contains at least one component and the component is the basic operation performed by the software, the main purpose of parsing the container is to determine the execution order of multiple related components in the container. By parsing out the execution order, the operation or function that the container is to perform can be determined.
[0035] 103. Determine the parsing results of each container based on the execution order.
[0036] Once the execution order of its multiple related components is determined, the corresponding components can be parsed one by one according to the execution order. Then, the parsing results of each related component are integrated according to the execution order to obtain the parsing result of the container.
[0037] In this step, all containers in the plugin code are parsed to obtain their respective parsing results. This process is not limited to parsing one by one according to the relationship between containers, or parsing multiple containers in parallel.
[0038] 104. Generate the front-end plugin corresponding to the plugin code based on the parsing results and the client's plugin environment.
[0039] This step can be divided into two stages. The first stage is to parse the parsing results of each container and then integrate the corresponding parsing results according to the relationship or cooperation between the containers to form a complete parsing result corresponding to the plugin code uploaded by the user. The second stage is to obtain the client's plugin environment, such as determining the operating system of the client, the display format and display method of the plugin, etc. Based on the plugin environment, the parsing results are processed to generate a front-end plugin that can run on the client.
[0040] Based on the above Figure 1 As can be seen from the implementation method, this embodiment of the invention achieves personalized plugin configuration by providing customers with a set of plugin configuration standards, i.e., preset rules. Customers can customize and write the required plugin code based on this configuration standard, and obtain an executable front-end plugin on their local client by uploading the plugin code. In this way, the plugin development process is completely delegated to the customer. For the software provider, it only needs to define and maintain the preset rules for configuring the plugin, without having to perform repeated secondary development according to user needs, which greatly reduces the maintenance cost of the application software; while for the customer, it can freely write plugin code based on the preset rules, saving high secondary development costs.
[0041] Furthermore, the preferred embodiment of the present invention is based on the above... Figure 1 Based on this, a detailed explanation of the plugin code processing procedure is provided, with the specific steps as follows: Figure 2 As shown, it includes:
[0042] 201. Obtain the plugin code written by the client according to preset rules.
[0043] This step and Figure 1 Step 101 in the embodiments is the same and will not be repeated here.
[0044] 202. Verify whether the plugin code is written according to the preset rules.
[0045] Since the plugin is written by the client user, this step verifies the plugin code before parsing it to ensure correct code parsing and to determine if it conforms to a standard. This standard is a preset rule, and the specific steps include:
[0046] First, the plugin code is checked against preset rules to ensure it meets standards. This check includes, but is not limited to, verifying that the code structure conforms to standards, such as the accuracy of container and component property definitions, descriptions of relationships between containers, and descriptions of dependencies between components.
[0047] Secondly, after verifying that there are no problems, the subsequent analysis steps can be performed. If problems are found in the plugin code, the code should be marked, the error information extracted, and the error information recorded in the form of tags or content summaries. The error information should then be fed back to the client so that the user can modify the plugin code based on these error messages.
[0048] It should be noted that when providing feedback on writing error messages to the client in this step, the content of the writing error message may be a writing error caused by the user's incorrect application of the preset rules, or it may be a misunderstanding of the preset rules by the user, such as the failure to configure necessary attributes. For different types of writing error messages, this embodiment of the invention can automatically generate modification suggestion information through the code context to assist users in quickly modifying the plugin code.
[0049] 203. Analyze the containers in the plugin code.
[0050] Since the plugin code primarily performs its functions through defined containers, the plugin's functionality can be determined by parsing these containers. Generally, plugin code defines multiple containers, whose functions work together to achieve the desired plugin functionality. Therefore, this step first involves analyzing the number of containers in the plugin code, and then extracting the container code corresponding to each container. Next, each container code is parsed independently. For multiple containers, the preferred parsing method is to parse the container code in parallel. However, when the number of containers exceeds the parallel processing capacity, asynchronous parallel parsing can be used to parse the container code.
[0051] It's important to note that this container code is a component of the plugin code. As explained above, the defined container contains multiple related components, and these components are fundamental operations of the software. Therefore, when there are multiple containers, different containers may use the same component. In this case, the component used in the container code needs to be parsed multiple times during parsing. In other words, the container code is not a truncated version of the plugin code, but rather, based on the container definition within the plugin code, it is composed of multiple parts of the plugin code.
[0052] 204. Determine the execution order of multiple related components within the same container.
[0053] This step analyzes the parsing order of multiple related components within a container of multiple containers in the plugin code. It includes:
[0054] First, the associated components in the container code are analyzed to determine the dependencies between them. Since the functionality implemented by the container is based on the operations corresponding to multiple components, the main purpose of analyzing the container code is to analyze the components within the container and the relationships between them. In this embodiment, the relationships between components are specifically the dependencies between them; that is, to implement the container's functionality, components need to be executed in a certain order, and the execution of one component depends on the execution result of another component associated with it.
[0055] Secondly, the execution order of parsing each component is determined based on the dependencies between components. Given these dependencies, the components must also be parsed in the order specified in those dependencies.
[0056] As can be seen, in this step, it is necessary to analyze the execution order of the related components in each container one by one. After determining the execution order, step 205 is executed to parse the container.
[0057] 205. Determine the parsing results of each container based on the execution order.
[0058] Before parsing the associated components within a container, this step requires finding the corresponding component resolver based on the identifier of each component. In this embodiment, the components are pre-set in the rule base by the software provider for direct user invocation. Correspondingly, the software provider also configures component resolvers for the provided components to facilitate the identification and parsing of user-written components. That is, the rule base pre-stores the correspondence between component identifiers and component resolvers.
[0059] Next, the found component resolvers are used to parse the associated components in the container according to a predetermined execution order. The parsing results of the components are obtained from each component resolver.
[0060] Furthermore, based on the parsing results of each related component, the parsing results of a single container are integrated according to the execution order of the components. The specific process includes:
[0061] First, determine whether the components in the container have finished parsing. In this embodiment, the specific parsing method for components is limited to parsing according to the execution order. That is, when there are dependencies between components, they need to be parsed sequentially, while when there are no dependencies between components, the parsing order is not limited and they can be parsed in parallel.
[0062] Subsequently, if it is determined that there are still unresolved components in the container, the corresponding component resolver is used to resolve these unresolved components, obtaining the component resolution result. Conversely, if it is determined that all components in the container have been resolved, the resolution results of each component are integrated according to the dependencies between components to obtain the container's resolution result, so that the function corresponding to the container can be implemented when the container's resolution result is executed. The process of integrating the component resolution results is also a process of parsing the container code. It parses how related components are associated, whether there are triggering conditions between the operations corresponding to two components, etc. Therefore, for the container code, its parsing process can be mainly divided into two parts: one part parses the components in the container one by one, and the other part parses the non-component code to determine the association conditions between components.
[0063] 206. Generate the front-end plugin corresponding to the plugin code based on the parsing results and the client's plugin environment.
[0064] This step involves generating the front-end plugin. The specific process includes:
[0065] First, it checks if there are any unresolved containers in the plugin code. If so, it continues the parsing process described in steps 204 and 205. If not, it obtains the client's plugin environment. Here, the client refers to the client that uploaded the plugin code. The plugin environment refers to the environment parameters required for the plugin to run on the client, including the client system's plugin architecture (such as plugin invocation and execution) and plugin styles (such as display methods, fonts, and colors). The purpose of obtaining the plugin environment is to generate a plugin that can run on the client and be displayed to the user.
[0066] Secondly, the parsing results of each container are integrated according to the plugin architecture to generate an executable plugin. This integration involves the parsing results of each container. Since the plugin code contains multiple containers, and the plugin's functionality requires the cooperation of these containers, the parsing process not only parses each individual container but also analyzes the relationships between them—that is, integrating the parsing results of each container. This integration is based on the plugin architecture of the client's plugin environment. Different clients have different plugin architectures, necessitating adaptation to the client's plugin architecture to integrate the parsing results of each container and obtain the executable plugin.
[0067] Finally, the executable plugin is packaged according to the plugin style to obtain the front-end plugin. An executable plugin is a plugin that can run on the client side, while a front-end plugin is a plugin that users can see and interact with through the client. This means that in addition to being executable, a front-end plugin also needs to have visual attributes. Therefore, the role of the plugin style is to define the plugin's display attributes on the client side. By packaging the executable plugin according to the client's plugin style, the generation of a visual plugin is achieved, allowing users to view the front-end plugin generated from their written plugin code on the client side.
[0068] Furthermore, in implementing the above Figure 1 , 2 Prior to the embodiments shown, the embodiments of the present invention first require specifying the preset rules followed by users when writing plugin code. To this end, these preset rules need to be configured on the software server side, and a rule base needs to be built. This rule base is also used to validate the plugin code written by users.
[0069] The constructed rule base includes not only rules for writing configuration code, but also configurations for components that clients can directly call. These components can be configured based on the basic operations within the software. Additionally, the relationships between components need to be configured, specifying which parameters or conditions need to be configured when setting two components as dependencies. This allows clients to set associated components by describing these relationships. Furthermore, commonly used containers can also be configured in the rule base to enable clients to quickly write plugin code.
[0070] Furthermore, regarding the rule base constructed above, since its configured rules are not fixed and will be updated as software functions are upgraded, this embodiment will periodically update the rule base. Specifically, it will periodically check for updated rules in the rule base, meaning updates to existing rules. If updated rules exist, the generated front-end plugins will be checked to find those related to the updated rules, i.e., plugins whose functionality is affected by the rule update. If a corresponding front-end plugin to be updated exists, this embodiment will send an update request to the client using that plugin, i.e., ask the client whether to update the plugin, rather than updating it directly. After the client approves the update request, the components in the front-end plugin to be updated will be updated according to the update rules, generating a new front-end plugin. Furthermore, the update request can include the functional changes caused by the update rules, allowing users to choose whether to update the front-end plugin according to their needs.
[0071] In this embodiment, in addition to periodically checking the rules in the rule base for newness, the rule base can also be proactively updated based on user needs, i.e., adding new rules to the rule base. New rules generally originate from software upgrade information or client requests for front-end plugins. The rule base will generate new rules based on this upgrade or request information and check for duplicates in the rule base. If a rule does not exist in the rule base, it will be added. For new rules configured based on request information, this embodiment will also generate corresponding summary information for the configured new rule and feed this summary information back to the client to inform them that their request has been received and transformed into a new rule in the rule base.
[0072] Furthermore, as a response to the above Figure 1 , 2The implementation of the method embodiment shown in this invention provides a custom plugin generation device. This device is applied to application software, allowing users to write and upload plugin code on the client side, and parsing the plugin code on the server side to generate a front-end plugin suitable for the client. The embodiment of this device corresponds to the foregoing method embodiments. For ease of reading, this embodiment will not repeat the details of the foregoing method embodiments one by one, but it should be clear that the device in this embodiment can implement all the contents of the foregoing method embodiments. Specifically, as shown... Figure 3 As shown, the device includes:
[0073] The acquisition unit 31 is used to acquire the plugin code written by the client according to preset rules. The plugin code has a container composed of multiple related components, wherein each related component is used to implement the basic operation of the software.
[0074] The parsing unit 32 is used to parse the container in the plugin code obtained by the acquisition unit 31 and determine the execution order of multiple related components in the same container;
[0075] Integration unit 33 is used to determine the parsing results of each container based on the execution order obtained by parsing unit 32;
[0076] The generation unit 34 is used to generate the front-end plugin corresponding to the plugin code based on the parsing result obtained by the integration unit 33 and the plugin environment of the client.
[0077] Furthermore, such as Figure 4 As shown, the parsing unit 32 includes:
[0078] Extraction module 321 is used to parse the number of containers in the plugin code and extract the container code corresponding to each container;
[0079] The first parsing module 322 is used to parse the container code obtained by the extraction module 321 according to the number of containers and the parallel parsing capability.
[0080] Furthermore, such as Figure 4 As shown, the parsing unit 32 further includes:
[0081] The first determining module 323 is used to parse the associated components in the container code and determine the dependencies between the components;
[0082] The second determining module 324 is used to determine the execution order of parsing each component based on the dependency relationship determined by the first determining module 323;
[0083] The integration unit 33 includes:
[0084] The lookup module 331 is used to find the corresponding component resolver based on the identifier of each component, wherein the correspondence between component identifiers and component resolvers is pre-stored;
[0085] The second parsing module 332 is used to parse the associated components according to the execution order of parsing each component using the component parser obtained by the search module 331.
[0086] Furthermore, such as Figure 4 As shown, the integration unit 33 further includes:
[0087] Module 333 is used to determine whether the components in the container have been completely parsed.
[0088] The parsing module 334 is used to parse the unparsed components using the corresponding component parser when the judgment module 333 determines that there are components that have not been parsed, and to obtain the component parsing result.
[0089] The integration module 335 is used to integrate the parsing results of each component according to the dependency relationship between the components when the judgment module 333 determines that the component parsing is complete, so as to obtain the parsing result of the container, so as to realize the function corresponding to the container when the parsing result of the container is executed.
[0090] Furthermore, such as Figure 4 As shown, the generation unit 34 includes:
[0091] The judgment module 341 is used to determine whether there is an unparsed container in the plugin code;
[0092] The acquisition module 342 is used to acquire the client's plugin environment when the judgment module 341 determines that there is no unresolved container. The plugin environment includes at least a plugin architecture and plugin style suitable for the client system.
[0093] Integration module 343 is used to integrate the parsing results of each container according to the plugin architecture obtained by acquisition module 342, and generate an executable plugin;
[0094] The generation module 344 is used to encapsulate the executable plugin generated by the integration module 343 according to the plugin style to obtain the front-end plugin.
[0095] Furthermore, such as Figure 4 As shown, before the parsing unit 32 performs parsing of the containers in the plugin code, the apparatus further includes:
[0096] The verification unit 35 is used to verify whether the plugin code obtained by the acquisition unit 31 is written in a standard manner according to preset rules.
[0097] Feedback unit 36 is used to record writing error information and feed back the writing error information to the client when the inspection unit 35 determines that the standard is not met.
[0098] The parsing unit 32 is further configured to parse the containers in the plug-in code when the verification unit 35 determines the standard.
[0099] Furthermore, such as Figure 4 As shown, the device further includes: a configuration unit 37, used to configure the preset rules, build a rule base for verifying plugin code; determine components that the client can directly call according to the preset rules; and configure the association relationships between components so that the client can set associated components according to the association relationships.
[0100] Furthermore, such as Figure 4 As shown, the device further includes: an update detection unit 38, used to periodically detect whether there are update rules in the rule base constructed by the configuration unit 37; if there are, the generated front-end plugins are detected to find the front-end plugins to be updated related to the update rules; an update request is sent to the client that applies the front-end plugin to be updated; if the client permits the update request, the components in the front-end plugin to be updated are updated according to the update rules to generate a new front-end plugin.
[0101] Furthermore, such as Figure 4 As shown, the device further includes: a configuration update unit 39, used to receive client request information for front-end plugins; configure new rules in the rule base according to the request information; and send summary information of the new rules to the client.
[0102] Furthermore, embodiments of the present invention also provide a processor for running a program, wherein the program executes the above-described... Figure 1-2 The method for generating custom plugins described in [the document].
[0103] Furthermore, embodiments of the present invention also provide a storage medium for storing a computer program, wherein the computer program, when running, controls the device where the storage medium is located to execute the above-described... Figure 1-2 The method for generating custom plugins described in [the document].
[0104] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0105] It is understood that the relevant features in the above methods and apparatus can be referenced interchangeably. Furthermore, the terms "first," "second," etc., in the above embodiments are used to distinguish between embodiments and do not represent the superiority or inferiority of any particular embodiment.
[0106] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0107] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0108] In addition, the memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0109] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0110] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0111] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0112] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0113] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0114] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0115] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0116] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0117] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0118] The above are merely embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A method for generating a custom plugin, characterized in that, The method includes: Obtain the plugin code written by the client according to preset rules. The plugin code has a container composed of multiple related components. Each related component is used to implement the basic operation of the software. The container is the code corresponding to the function composed of the combination of components. The container in the plugin code is parsed, and the execution order of multiple related components in the same container is determined; The parsing results of each container are determined based on the execution order; Based on the parsing results and the client's plugin environment, a front-end plugin corresponding to the plugin code is generated; Parsing the containers in the plugin code includes: The number of containers in the plugin code is analyzed, and the container code corresponding to each container is extracted. Based on the number of containers and the parallel parsing capability, parse the container code; Based on the parsing results and the client's plugin environment, a front-end plugin corresponding to the plugin code is generated, including: Determine if there are any unresolved containers in the plugin code; If it does not exist, then obtain the plugin environment of the client, which includes at least the plugin architecture and plugin style applicable to the client system; Based on the plugin architecture, the parsing results of each container are integrated to generate an executable plugin; The executable plugin is encapsulated according to the plugin style to obtain the front-end plugin.
2. The method according to claim 1, characterized in that, Determine the execution order of multiple related components within the same container, including: Analyze the related components in the container code to determine the dependencies between components; The execution order of each component is determined based on the dependencies; The determination of the parsing results for each container based on the execution order includes: The corresponding component resolver is found based on the identifier of each component, wherein the correspondence between component identifiers and component resolvers is stored in advance; The component parser is used to parse the associated components in the order of execution of parsing each component, so as to obtain the parsing result of the container.
3. The method according to claim 2, characterized in that, The parsing results of each container are determined based on the execution order, including: Determine whether the components in the container have been completely parsed; If not completed, the corresponding component resolver is used to parse the unparsed components to obtain the component parsing results; If completed, the parsing results of each component are integrated according to the dependencies between components to obtain the parsing result of the container, so that the function corresponding to the container can be implemented when the parsing result of the container is executed.
4. The method according to any one of claims 1-3, characterized in that, Before parsing the containers in the plugin code, the method further includes: The plugin code is checked for standardization according to preset rules. If it is not standard, the writing error message is recorded and fed back to the client; If the standard is met, then the container in the plugin code will be parsed.
5. The method according to any one of claims 1-3, characterized in that, The method further includes: Configure the preset rules to build a rule base for verifying plugin code; The components that the client can directly call are determined according to the preset rules; Configure the relationships between components so that the client can set associated components based on the relationships.
6. The method according to claim 5, characterized in that, The method further includes: Periodically check if there are any updated rules in the rule base; If it exists, the generated front-end plugins are checked to find the front-end plugins to be updated that are related to the update rules. Send an update request to the client that is using the front-end plugin to be updated; If the client grants permission for the update request, the components in the front-end plugin to be updated will be updated according to the update rules, and a new front-end plugin will be generated.
7. The method according to claim 5, characterized in that, The method further includes: Receive client requests for front-end plugins; Configure new rules in the rule base according to the aforementioned requirements; The summary information of the new rule is sent to the client.
8. A device for generating custom plugins, characterized in that, The device includes: The acquisition unit is used to acquire the plugin code written by the client according to preset rules. The plugin code has a container composed of multiple related components. Each related component is used to implement the basic operation of the software. The container is the code corresponding to the function composed of the combination of components. The parsing unit is used to parse the container in the plugin code obtained by the acquisition unit and determine the execution order of multiple related components in the same container; An integration unit is used to determine the parsing results of each container based on the execution order obtained by the parsing unit; A generation unit is used to generate a front-end plugin corresponding to the plugin code based on the parsing results obtained by the integration unit and the plugin environment of the client. The parsing unit is specifically used to parse the number of containers in the plugin code and extract the container code corresponding to each container; based on the number of containers and the parallel parsing capability, it parses the container code. The generation unit is specifically used to determine whether there are unparsed containers in the plugin code; if not, it obtains the plugin environment of the client, which includes at least a plugin architecture and plugin style suitable for the client system; it integrates the parsing results of each container according to the plugin architecture to generate an executable plugin; and it encapsulates the executable plugin according to the plugin style to obtain the front-end plugin.
9. A processor, characterized in that, The processor is used to run a program, wherein the program executes the method for generating a custom plugin as described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium is used to store a computer program, wherein the computer program, when running, controls the device where the storage medium is located to execute the method for generating a custom plugin as described in any one of claims 1-7.