Dynamic plug-in expansion system and method based on xml-pull

Through a dynamic plug-in extension system based on xml-pull, xml files are built and parsed, the problems of plug-in extension failure and interference with the application in the existing technology are solved, and the stable dynamic expansion of plug-ins and applications are realized.

CN119149138BActive Publication Date: 2025-03-18浙江网盛数新软件股份有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411648231.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-18
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

When existing dynamic expansion systems expand plug-in, they are prone to failure of extension due to incompatibility with the application environment, and may interfere with the original program of the application.

Method used

The dynamic plug-in extension system based on xml-pull is adopted. The basic information of the plug-in is extracted through the file building module and the xml file is constructed. Combined with the demand determination module, interface filtering module and coefficient calculation module, it determines whether the plug-in meets the dynamic expansion requirements, and parses the xml file based on the xml-pull parser through the dynamic expansion module to control the dynamic expansion of the plug-in.

Benefits of technology

It effectively avoids the expansion failure of unreasonable plug-ins during dynamic expansion, ensures the dynamic connection between the plug-ins and the application, and prevents interference with the stable operation of the application when the plug-ins dynamically expand.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149138B_ABST
    Figure CN119149138B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of plug-in extension, and discloses a dynamic plug-in extension system and method based on XML-Pull; the system comprises the following steps: selecting plug-in features from basic information, constructing the plug-in features into an XML file, obtaining extended attributes of the XML file, determining whether dynamic extension requirements are met, selecting extensible interfaces from interfaces, calculating the extension coefficients of the extensible interfaces, selecting target interfaces from the extensible interfaces, importing the XML file into the target interface of an application, and parsing the XML file; compared with the prior art, the present invention can make a preliminary determination on whether a plug-in meets the dynamic extension requirements, avoid the phenomenon of unreasonable plug-ins failing to extend during dynamic extension, and also prevent the plug-in from affecting the stable operation of the application during dynamic extension, and avoid the problem of the plug-in causing interference to the original program of the application during dynamic extension.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of plug-in extension, and more specifically, to a dynamic plug-in extension system and method based on XML-Pull. Background Art

[0002] A plug-in refers to an additional functional module added to software or applications to extend the functionality of the software or application, allowing users to customize and enhance the functionality of the software according to their own needs. XML-pull is a lightweight library for parsing XML that can interpret the information contained in the plug-in. In order to ensure that the plug-in can be dynamically extended with the application, it is necessary to use XML-pull to read and parse the extended content of the plug-in.

[0003] The patent application with reference publication number CN118484244A discloses an extensible plug-in system, method, device and storage medium, including an executable plug-in determination module for providing plug-in standards; a plug-in registration and discovery module for registering the metadata of the executable plug-in; a plug-in loading and unloading module for loading the executable plug-in class; a plug-in life cycle and service management module for managing the life cycle of the executable plug-in class by using the target manager to complete the call of the plug-in method and perform plug-in service management based on the application programming interface;

[0004] When expanding a plug-in, the existing dynamic expansion system adopts the method of directly obtaining the expansion information of the plug-in, and based on the expansion information, configures the expansion protocol on the application to achieve the expansion effect of the plug-in. Since different plug-ins have different types of expansion information, when the expansion information of the plug-in is incompatible with the expansion environment of the application, the rationality of the plug-in expansion will be greatly reduced, which may easily lead to the phenomenon that the dynamic expansion cannot be completed when the subsequent plug-in and application are expanded, and it may also cause negative interference to the original program of the application.

[0005] In view of this, the present invention proposes a dynamic plug-in expansion system and method based on XML-Pull to solve the above problems. Summary of the invention

[0006] In order to overcome the above defects of the prior art and to achieve the above objectives, the present invention provides the following technical solutions: a dynamic plug-in extension system based on xml-pull, applied to an extension platform, comprising:

[0007] A file construction module is used to extract basic information of the plug-in, filter out plug-in features from the basic information, the plug-in features include dependency features, compatibility features, format features and license features, and construct the plug-in features into an XML file based on the file construction criteria;

[0008] The demand determination module is used to obtain the extended attributes of the XML file, the extended attributes include type value and form value, calculate the demand coefficient of the XML file, and determine whether the dynamic expansion demand is met;

[0009] The interface screening module is used to identify the attribute status of the application program interface one by one, the attribute status includes busy interface and idle interface, and screen out the extensible interface from the interface according to the attribute status;

[0010] The coefficient calculation module is used to obtain the extended parameters of the extensible interface, which include the number of concurrent requests, the effective response time and the error ratio. According to the extended parameters, the expansion coefficient of the extensible interface is calculated, and the target interface is selected from the extensible interface.

[0011] The dynamic extension module is used to import XML files into the application through the target interface, parse the XML files based on the XML-pull parser, and control the dynamic extension of the plug-in.

[0012] Furthermore, the screening methods of dependency features, compatibility features, format features and licensing features include:

[0013] Query the comprehensive information of the plug-in through the information management system, mark the identity remark boxes of the comprehensive information one by one, and identify the remark words in the identity remark boxes;

[0014] The identity remark box with the remark word "plugin" is recorded as the basic remark box, and the comprehensive information corresponding to the basic remark box is recorded as the basic information;

[0015] Through natural language processing technology, the key semantics of basic information are identified one by one, and the key semantics are split to obtain text semantics and digital semantics;

[0016] The key semantics with textual semantics of dependency, compatibility, format and permission are recorded as dependency semantics, compatibility semantics, format semantics and permission semantics respectively, and the dependency semantics, compatibility semantics, format semantics and permission semantics are combined with the corresponding digital semantics head and tail to generate dependency features, compatibility features, format features and permission features.

[0017] Furthermore, the file construction criteria are: only one plug-in feature is included in a feature bit;

[0018] The construction methods of xml files include:

[0019] A blank basic file is constructed by using a file construction tool, and four feature bits arranged in a straight line are sequentially drawn in the basic file;

[0020] In a manner from front to back, the four characteristic bits are numbered in ascending order to obtain a first characteristic bit, a second characteristic bit, a third characteristic bit and a fourth characteristic bit;

[0021] Marking file association points at both ends of the first feature bit, the second feature bit, the third feature bit and the fourth feature bit respectively, and establishing an association channel between two adjacent file association points;

[0022] The dependent features, compatible features, format features and permission features are imported into the first feature bit, the second feature bit, the third feature bit and the fourth feature bit one by one to generate an XML file.

[0023] Furthermore, the method for obtaining the type value and the form value includes:

[0024] Query i attribute information of the XML file through the technical parameter table, and mark the attribute words of the i attribute information one by one, and record the attribute information whose attribute words are type and form as first information and second information respectively;

[0025] The construction time of all the first information and the second information is queried one by one through the timestamp, and the construction time is arranged one by one in the order of time to generate the first arrangement row and the second arrangement row;

[0026] The first information with the same construction time in the first arrangement row is recorded as type information, and the number of type information is counted to obtain the type value;

[0027] Record the second information without the same construction time in the second arrangement row as form information, and count the number of form information to obtain the form value;

[0028] The expression of demand coefficient is: ;

[0029] In the formula, is the demand coefficient of the xml file, The type value of the XML file. It is a value in the form of an XML file.

[0030] Furthermore, the method for determining whether the dynamic expansion requirement is met includes: With the preset demand threshold Compare;

[0031] when Greater than or equal to When , it is determined that the dynamic expansion requirements are met;

[0032] when Less than , it is determined that the dynamic expansion requirement is not met.

[0033] Furthermore, the method for identifying a busy interface and an idle interface includes:

[0034] Query the work logs of the p interfaces of the application program one by one through the database, and mark the status indicator columns from the work logs to obtain p status indicator columns;

[0035] Identify the potential values ​​in the p status indicator columns one by one, and count the number of all potential values ​​to obtain p total values;

[0036] Count the number of potential values ​​0 in p status indicator columns one by one to obtain p working low-level values;

[0037] When the working low value of the interface is greater than or equal to two-thirds of the total value, the attribute state of the interface is recorded as an idle interface;

[0038] When the working low value of the interface is less than two-thirds of the total value, the attribute state of the interface is recorded as a busy interface;

[0039] The screening methods of the extensible interface include:

[0040] When the attribute status of the interface is busy, the interface is not recorded as an extensible interface;

[0041] When the interface attribute of the interface is busy, the interface is recorded as an extensible interface. An extensible interface.

[0042] Furthermore, the method for obtaining the effective response time includes:

[0043] Through the log management system, we can query The historical operation log of an extensible interface is obtained by marking the execution request in the historical operation log. Execute requests;

[0044] Query one by one by timestamp The receiving time and execution time of the execution request are recorded as the sub-duration, and the Length of time;

[0045] Will After accumulating the duration of each sub-item, we find the average value. Effective response time;

[0046] The expression of effective response time is: ;

[0047] In the formula, For the The effective response time of an extensible interface, For the The first extensible interface The length of the child.

[0048] Furthermore, the method for obtaining the error ratio value includes:

[0049] Take the current time as the starting point and work backwards for a preset return cycle to generate a request tracing period;

[0050] Use system monitoring tools to query one by one An extensible interface collects all return requests within the request tracing period, marks the status boxes of all return requests one by one, and identifies the status values ​​in the status boxes;

[0051] The status box with a status value of 1 is recorded as an error box, the return request corresponding to the error box is recorded as an error request, and the number of error requests is counted to obtain Error value;

[0052] Count one by one The total number of requests returned by the extensible interface, The total value of the request, and The error values ​​are Compare the total value of requests and get The error percentage value;

[0053] The expression of error ratio is: ;

[0054] In the formula, For the The error ratio of the extensible interface, For the The error value of the extensible interface, For the The total value of requests for extensible interfaces;

[0055] The expression of the expansion factor is: ;

[0056] In the formula, For the The expansion factor of the extensible interface, For the The number of concurrent requests for the extensible interface, is a weight factor greater than 0.

[0057] Furthermore, the parsing method of the XML file includes:

[0058] Switch the working state of the target interface to the on state, import the XML file into the target interface of the application, and switch the working state of the target interface to the off state;

[0059] Mark the first and last information bits in the XML file as the parsing start and end points;

[0060] Introduce the xml-pull parser into the application, and read and parse the information in the xml file in the order from the parsing start point to the parsing end point until the xml file is parsed.

[0061] The dynamic plug-in extension method based on XML-pull is applied to the extension platform and is implemented based on the dynamic plug-in extension system based on XML-pull, including:

[0062] S1: extract the basic information of the plug-in, filter out the plug-in features from the basic information, the plug-in features include dependency features, compatibility features, format features and license features, and construct the plug-in features into an XML file based on the file construction criteria;

[0063] S2: Obtain the extended attributes of the XML file, which include type value and form value, calculate the demand coefficient of the XML file, and determine whether the dynamic expansion demand is met;

[0064] S3: If the dynamic expansion requirements are met, the attribute status of the application program interface is identified one by one, the attribute status includes busy interface and idle interface, and the extensible interface is selected from the interface according to the attribute status;

[0065] S4: Obtain extended parameters of the extensible interface, which include the number of concurrent requests, effective response time, and error ratio. According to the extended parameters, calculate the expansion coefficient of the extensible interface, and select the target interface from the extensible interface.

[0066] S5: Import the XML file into the application through the target interface, parse the XML file based on the XML-pull parser, and control the dynamic expansion of the plug-in.

[0067] Technical effects and advantages of the xml-pull-based dynamic plug-in expansion system and method of the present invention:

[0068] The present invention extracts basic information of the plug-in, filters out plug-in features from the basic information, and constructs the plug-in features into an XML file based on a file construction criterion, obtains extended attributes of the XML file, calculates the demand coefficient of the XML file, and determines whether the dynamic expansion demand is met, identifies the attribute status of the interface of the application program one by one, and filters out the extensible interface from the interface according to the attribute status, obtains the extended parameters of the extensible interface, calculates the expansion coefficient of the extensible interface according to the extended parameters, and filters out the target interface from the extensible interface, imports the XML file into the application program through the target interface, parses the XML file based on an XML-pull parser, and controls the dynamic expansion of the plug-in; compared with the prior art, the present invention uses file construction to According to the criterion, the plug-in features of the plug-in can be constructed into an XML file, and after calculating the expansion coefficient of the XML file, a preliminary judgment can be made on whether the plug-in meets the dynamic expansion requirements, thereby avoiding the phenomenon of unreasonable plug-ins failing to expand during dynamic expansion, and achieving the pre-order recognition effect of dynamic expansion of the plug-in. At the same time, the expansion coefficient can be calculated in combination with the expansion parameters, and the target interface can be accurately screened out from the extensible interface, thereby ensuring the dynamic connection effect between the XML file and the application, ensuring that the XML file can perform efficient and accurate dynamic expansion operations in the application through the target interface, and also preventing the plug-in from affecting the stable operation of the application when it is dynamically expanded, and avoiding the problem of interference with the original program of the application when the plug-in is dynamically expanded. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 A schematic diagram of the architecture of a dynamic plug-in extension system based on XML-Pull provided in the first embodiment of the present invention;

[0070] Figure 2 A schematic diagram of modules of a dynamic plug-in expansion system based on XML-Pull provided in the first embodiment of the present invention;

[0071] Figure 3 A schematic diagram of the flow of a dynamic plug-in expansion method based on xml-pull provided in the second embodiment of the present invention;

[0072] Figure 4 A schematic diagram of a structural diagram of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0073] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0074] Example 1: Please refer to Figure 1 and Figure 2 As shown, the dynamic plug-in extension system based on xml-pull described in this embodiment is applied to the extension platform, including:

[0075] The file construction module extracts the basic information of the plug-in, selects the plug-in features from the basic information, and constructs the plug-in features into an XML file based on the file construction criteria;

[0076] Basic information refers to the comprehensive basic parameters of the plug-in that can be dynamically extended with the application, that is, the plug-in that needs to be extended with the application can be specifically represented, thereby providing a basis for the dynamic extension of subsequent plug-ins;

[0077] Plugin features refer to features that can affect the success or failure of dynamic extension operations between plugins and applications, and are used as objects to construct XML files. They can also accurately and concisely represent the relevant extension features of plugins.

[0078] Plugin features include dependency features, compatibility features, format features, and licensing features; dependency features refer to the dependency environment and conditions required by the plugin when it is dynamically extended, compatibility features refer to the platform and version required by the plugin when it is dynamically extended, format features refer to the file type required by the plugin when it is dynamically extended, and licensing features refer to the identity permissions required by the plugin when it is dynamically extended;

[0079] The screening methods for dependency features, compatibility features, format features, and licensing features include:

[0080] The comprehensive information of the plug-in is queried through the information management system, the identity remark boxes of the comprehensive information are marked one by one, and the remark words in the identity remark boxes are identified; the comprehensive information refers to the information that can represent all the contents of the plug-in, that is, the plug-in can be fully represented, the identity remark box is used to summarize the content of the type to which the comprehensive information belongs, and the remark words are phrases used to directly represent the type to which the comprehensive information belongs, and are used to accurately distinguish different types of comprehensive information;

[0081] The identity remark box with the remark word "plugin" is recorded as the basic remark box, and the comprehensive information corresponding to the basic remark box is recorded as the basic information;

[0082] Through natural language processing technology, the key semantics of basic information are identified one by one, and the key semantics are split to obtain textual semantics and digital semantics; key semantics are words used to directly and clearly express the true meaning of basic information, so as to achieve a concise and effective expression effect of basic information;

[0083] The key semantics with textual semantics as dependencies are recorded as dependency semantics, and the dependency semantics are combined with the corresponding numeric semantics to generate dependency features;

[0084] The key semantics with compatible text semantics are recorded as compatible semantics, and the compatible semantics are combined with the corresponding digital semantics at the beginning and end to generate compatible features;

[0085] The key semantics of the format with text semantics is recorded as format semantics, and the format semantics is combined with the beginning and end of the corresponding digital semantics to generate format features;

[0086] The key semantics of the license with text semantics is recorded as the license semantics, and the license semantics is combined with the corresponding digital semantics to generate the license feature.

[0087] After obtaining the plug-in features, an XML file can be constructed according to the plug-in features, so that the XML file can be associated and integrated with the application and provide an object for the subsequent dynamic expansion of the plug-in;

[0088] When constructing the plug-in features into an XML file, it is necessary to ensure that the multiple plug-in features in the constructed XML file maintain order and stability to prevent the plug-in features in the XML file from interfering with each other and being misplaced. Therefore, it is necessary to use file construction criteria to restrict the construction of the XML file.

[0089] The file construction criteria are: one feature position contains only one plug-in feature; ensure that multiple plug-ins in the XML file are independent of each other, avoid the plug-in features in adjacent feature positions from sticking together, and improve the stability of the XML file;

[0090] The construction methods of xml files include:

[0091] Use the file construction tool to construct a blank basic file, and draw four feature bits arranged in a straight line in the basic file in sequence; the basic file refers to a blank file without substantial content, and serves as the basis for the construction of subsequent XML files. The feature bit is the smallest unit that constitutes the basic file, and is used to provide the accurate location for importing data in the XML file;

[0092] In a manner from front to back, the four characteristic bits are numbered in ascending order to obtain a first characteristic bit, a second characteristic bit, a third characteristic bit and a fourth characteristic bit;

[0093] File association points are marked at both ends of the first feature bit, the second feature bit, the third feature bit and the fourth feature bit, and an association channel is established between two adjacent file association points; a file association point refers to an output point and an input point on a feature bit for information exchange, and an association channel is an information exchange channel constructed on a file association point between two adjacent feature bits, so that information on two adjacent feature bits can be linked to each other, so that the information in the feature bits in the XML file can have a comprehensive and accurately associated representation effect on the plug-in;

[0094] The dependent features, compatible features, format features and permission features are imported into the first feature bit, the second feature bit, the third feature bit and the fourth feature bit one by one to generate an XML file.

[0095] It should be noted that a feature bit contains only one plug-in feature, so that an XML file can orderly and independently represent the features that affect the dynamic expansion of the plug-in, and the plug-in features in two adjacent feature bits can be associated through an association channel to ensure the association transmission effect between multiple plug-in features and ensure the integrity of the plug-in.

[0096] The demand determination module obtains the extended attributes of the XML file, calculates the demand coefficient of the XML file, and determines whether the dynamic expansion demand is met;

[0097] Extension attributes are the basis for judging whether an XML file can be dynamically extended. They can also accurately represent the type and form of the XML file and provide a basis for subsequent identification and analysis of the XML file.

[0098] Extension attributes include type value and form value; type value is used to indicate the quantity of different types of dynamic extension requirements in the XML file, that is, to indicate the number of extension types in the XML file; form value is used to indicate the quantity of different forms of dynamic extension requirements in the XML file, that is, to indicate the number of extension forms in the XML file;

[0099] The methods for obtaining type and form values ​​include:

[0100] Query i attribute information of the XML file through the technical parameter table, and mark the attribute words of the i attribute information one by one, and record the attribute information whose attribute words are type and form as first information and second information respectively; attribute information is used to represent information of different types and forms in the XML file, and attribute words are the smallest unit for constructing attribute information, and directly represent the type and form;

[0101] The construction time of all the first information and the second information is queried one by one through the timestamp, and the construction time is arranged one by one in the order of time to generate the first arrangement row and the second arrangement row;

[0102] The first information with the same construction time in the first arrangement row is recorded as type information, and the number of type information is counted to obtain the type value;

[0103] The second information without the same construction time in the second arrangement row is recorded as form information, and the number of form information is counted to obtain the form value.

[0104] The demand coefficient is a numerical representation of the rationality of dynamic expansion of XML files and applications, and serves as a basis for subsequent judgment on whether the XML file meets the dynamic expansion requirements;

[0105] The expression of demand coefficient is: ;

[0106] In the formula, is the demand coefficient of the xml file, The type value of the XML file. It is a value in the form of an XML file.

[0107] Dynamic extension requirements are used to indicate whether the XML file meets the basic dynamic extension requirements of the application. This means that the rationality of the XML file can be verified. When the XML file lacks basic rationality, the dynamic extension requirements of the plug-in can be denied, thus avoiding the negative impact of unreasonable dynamic extension requirements of the plug-in on the stability of the application itself.

[0108] Methods for determining whether dynamic expansion requirements are met include:

[0109] The requirement coefficient of the xml file With the preset demand threshold Comparison; The preset demand threshold is used to represent the maximum value of the demand coefficient when the rationality of dynamic expansion of XML files is not within the prescribed range and the dynamic expansion demand of XML files is not within the normal range, so as to effectively and accurately distinguish the demand coefficient of XML files, thereby providing a basis for judging whether to perform dynamic expansion operations in the future; The preset demand threshold is obtained by collecting a large number of historical XML files for which the rationality of dynamic expansion is not within the prescribed range and the dynamic expansion demand of XML files is not within the normal range, and then calculating the average value of the maximum value of the demand coefficient;

[0110] when Greater than or equal to When , it indicates that the demand coefficient of the XML file is greater than or equal to the preset demand threshold. At this time, the rationality of the dynamic expansion of the XML file is within the specified range, and the dynamic expansion demand of the XML file does not exceed the normal range, then it is determined that the dynamic expansion demand is met;

[0111] when Less than When , it means that the demand coefficient of the XML file is less than the preset demand threshold. At this time, the rationality of the dynamic expansion of the XML file is not within the prescribed range, and the dynamic expansion demand of the XML file exceeds the normal range, then it is determined that the dynamic expansion demand is not met.

[0112] The interface screening module identifies the attribute status of the application program interface one by one, and screens the extensible interface from the interface according to the attribute status;

[0113] The attribute state is used to represent the information of the application's extended interface, thereby concisely representing the meaning and information of each application's interface and effectively identifying the different usage requirements of the application's interface in the future;

[0114] The attribute status includes a busy interface and an idle interface; a busy interface means that the extension interface of the application is in a busy working state and does not have the effect of dynamic extension, and an idle interface means that the extension interface of the application is in an idle working state and has the effect of dynamic extension;

[0115] Methods for identifying busy interfaces and idle interfaces include:

[0116] The work logs of the p interfaces of the application program are queried one by one through the database, and the status indicator bar is marked from the work log to obtain p status indicator bars; the work log is used to overall represent the operation status of the interface in the historical time period, and the status indicator bar is used to directly represent the working status of the interface;

[0117] Identify the potential values ​​in the p status indicator columns one by one, and count the number of all potential values ​​to obtain p total values; the potential value is a numerical representation of whether the interface is in a working state or a non-working state, and the potential value includes 1 and 0; when the potential value is 1, it indicates that the interface is in a working state at this time, and when the potential value is 0, it indicates that the interface is in a non-working state at this time;

[0118] Count the number of potential values ​​0 in p status indicator columns one by one to obtain p working low-level values;

[0119] When the working low value of the interface is greater than or equal to two-thirds of the total value, it means that the number of potential values ​​in the status indicator column that are 0 is large, and the interface is in the idle state for a long period of time, and the attribute state of the interface is recorded as an idle interface;

[0120] When the working low value of the interface is less than two-thirds of the total value, it means that the number of potential values ​​0 in the status indicator column is small, and the period of time when the interface is in the idle state is short, and the attribute state of the interface is recorded as a busy interface.

[0121] After the attribute status of the application program interface is identified, the interface that meets the dynamic expansion requirements can be effectively identified according to the different attribute status of each interface, and the extensible interface can be obtained, so that the extensible interface can be used as an alternative interface for the subsequent dynamic expansion of the entry plug-in;

[0122] The screening methods of the extensible interface include:

[0123] When the attribute status of the interface is busy, the interface of the application will be frequently busy, and the interface cannot provide sufficient and stable import expansion requirements for the dynamic expansion of the plug-in, so the interface will not be recorded as an extensible interface;

[0124] When the interface attribute of an interface is in a busy state, the interface of the application will not be in a busy state frequently. The interface can provide sufficient and stable import expansion requirements for the dynamic expansion of the plug-in. Then the interface is recorded as an extensible interface. An extensible interface.

[0125] It should be noted that the extensible interface is only used to represent the interface that meets the dynamic expansion requirements of the plug-in. At this time, the number of extensible interfaces is usually greater than 1, indicating that the number of extensible interfaces that meet the dynamic expansion requirements of the plug-in is large. In order to better filter out the best interface from the extensible interface, it is necessary to further analyze and filter multiple extensible interfaces.

[0126] A coefficient calculation module obtains the expansion parameters of the extensible interface, calculates the expansion coefficient of the extensible interface according to the expansion parameters, and selects the target interface from the extensible interface;

[0127] Extension parameters refer to data that can affect the performance change of the extensible interface when it meets the dynamic extension of the plug-in. They can indicate the performance strength of the extensible interface when it meets the dynamic extension of the plug-in, and thus serve as a basis for subsequent selection of the extensible interface with the strongest performance.

[0128] Extended parameters include the number of concurrent requests, effective response time, and error ratio;

[0129] The number of concurrent requests refers to the maximum number of requests that the extensible interface can receive and process simultaneously when the load is running, which can be used to represent the number of requests that the extensible interface can handle simultaneously. The larger the number of concurrent requests, the larger the maximum number of requests that the extensible interface can receive and process simultaneously when the load is running. At this time, the stronger the dynamic expansion performance of the extensible interface plug-in, the greater the expansion coefficient. The number of concurrent requests is obtained by querying the database for the maximum number of requests processed by the extensible interface at the same time point when the historical load is running;

[0130] The effective response time refers to the time from when the extensible interface receives a request to when it executes the request when the load is running, which can be used to indicate the processing time efficiency of the extensible interface for the request. The longer the effective response time is, the longer the time from when the extensible interface receives a request to when it executes the request when the load is running. At this time, the performance of the extensible interface in dynamic plug-in expansion is weaker, and the expansion coefficient is smaller.

[0131] Methods for obtaining effective response time include:

[0132] Through the log management system, we can query The historical operation log of an extensible interface is obtained by marking the execution request in the historical operation log. Execute requests;

[0133] Query one by one by timestamp The receiving time and execution time of the execution request are recorded as the sub-duration, and the Length of time;

[0134] Will After accumulating the duration of each sub-item, we find the average value. Effective response time;

[0135] The expression of effective response time is: ;

[0136] In the formula, For the The effective response time of an extensible interface, For the The first extensible interface The length of the child.

[0137] The error ratio value refers to the ratio of the number of error requests returned by the extensible interface per unit time to the total number during load operation, which can be used to indicate the correctness of the extensible interface in processing requests. The larger the error ratio value, the larger the ratio of the number of error requests returned by the extensible interface per unit time to the total number during load operation. At this time, the performance of dynamic expansion of the extensible interface plug-in is weaker, and the expansion coefficient is smaller.

[0138] Methods for obtaining the error ratio value include:

[0139] The request tracing period is generated by taking the current time as the starting point and working backwards for a preset return cycle. The preset return cycle is the maximum time limit for tracing the return request, which can ensure that the relevant data of the return request can be queried and recorded within a reasonable time range.

[0140] Use system monitoring tools to query one by one An extensible interface collects all return requests within the request tracing period, marks the status boxes of all return requests one by one, and identifies the status values ​​in the status boxes; the status box is a set of notes for the specific type of the return request, and the status value is a numerical representation of the specific type of the return request; the status values ​​include 1 and 2; when the status value is 2, it means that the return request is in a correct state, and when the status value is 1, it means that the return request is in an error state;

[0141] The status box with a status value of 1 is recorded as an error box, the return request corresponding to the error box is recorded as an error request, and the number of error requests is counted to obtain Error value;

[0142] Count one by one The total number of requests returned by the extensible interface, The total value of the request, and The error values ​​are Compare the total value of requests and get The error percentage value;

[0143] The expression of error ratio is: ;

[0144] In the formula, For the The error ratio of the extensible interface, For the The error value of the extensible interface, For the The total number of requests for the extensible interface.

[0145] After obtaining the number of concurrent requests, effective response time, and error ratio, the expansion factor can be calculated based on the number of concurrent requests, effective response time, and error ratio, so that the expansion factor can be used as a basis for judging the target interface.

[0146] The expression of the expansion factor is: ;

[0147] In the formula, For the The expansion factor of the extensible interface, For the The number of concurrent requests for the extensible interface, is a weight factor greater than 0;

[0148] in, , exemplary, is 0.43, is 0.35, is 0.22, The setting is to balance the proportion of concurrent requests, effective response time and error ratio in the expansion factor, so as to ensure that the expansion factor can maintain a dynamic balance between the concurrent requests, effective response time and error ratio.

[0149] After the expansion coefficient is calculated, the dynamic expansion performance of the extensible interface can be represented according to the size of the expansion coefficient, so that the extensible interface with the strongest dynamic expansion performance can be screened out as the target interface for subsequent use according to the size of the expansion coefficient; therefore, the extensible interface corresponding to the maximum expansion coefficient can be recorded as the target interface.

[0150] Dynamic extension module, imports XML files into the application through the target interface, parses the XML files based on the XML-pull parser, and controls the dynamic extension of the plug-in;

[0151] After the target interface is obtained, the target interface can be used as an interface for importing XML files and applications for dynamic expansion. Before the XML file is dynamically expanded, the constructed XML file needs to be parsed so that the application can directly and accurately obtain the expansion requirements of the plug-in and provide guarantee for the subsequent dynamic expansion of the plug-in.

[0152] The parsing methods of xml files include:

[0153] Switch the working state of the target interface to the open state, import the XML file into the target interface of the application, and switch the working state of the target interface to the closed state; the working state refers to the running state of the target interface that can import the XML file, thereby indicating the opening and closing status of the target interface; illustratively, the working state includes the open state and the closed state;

[0154] Mark the first and last information bits in the XML file as the parsing start and end points;

[0155] Introduce the xml-pull parser into the application, and read and parse the information in the xml file in the order from the parsing start point to the parsing end point until the xml file is parsed.

[0156] After the XML file is parsed, the parsed XML file can be dynamically extended in the application, so that the target interface of the application can be effectively connected and dynamically extended with the plug-in;

[0157] When a plug-in is dynamically expanded, it is necessary to effectively control the dynamic expansion process between the plug-in and the application. Therefore, it is necessary to configure an extension protocol with the same mechanism between the application and the plug-in, so that the application and the plug-in can use reflective dynamic loading of the plug-in under the restriction of the extension protocol to achieve the dynamic expansion effect of the plug-in, and ensure that the application can maintain a dynamic balance when dynamically expanding the plug-in, to prevent the dynamic expansion of the plug-in from affecting the stable operation of the application, and to avoid interference with the original program of the application when the plug-in is dynamically expanded.

[0158] In this embodiment, by extracting the basic information of the plug-in, filtering out the plug-in features from the basic information, and constructing the plug-in features into an XML file based on the file construction criteria, obtaining the extended attributes of the XML file, calculating the demand coefficient of the XML file, and determining whether the dynamic expansion requirements are met, the attribute status of the interface of the application is identified one by one, and according to the attribute status, the extensible interface is filtered out from the interface, the extended parameters of the extensible interface are obtained, and according to the extended parameters, the expansion coefficient of the extensible interface is calculated, and the target interface is filtered out from the extensible interface, and the XML file is imported into the application through the target interface, and the XML file is parsed based on the XML-Pull parser, and the dynamic expansion of the plug-in is controlled; compared with the prior art, the file construction is used to By building criteria, the plug-in features of the plug-in can be constructed into an XML file, and after calculating the expansion coefficient of the XML file, a preliminary judgment can be made on whether the plug-in meets the dynamic expansion requirements, avoiding the failure of unreasonable plug-ins to expand during dynamic expansion, and achieving the pre-order recognition effect of dynamic expansion of the plug-in. At the same time, the expansion coefficient can be calculated in combination with the expansion parameters, and the target interface can be accurately screened out from the extensible interface, thereby ensuring the dynamic connection effect between the XML file and the application, ensuring that the XML file can perform efficient and accurate dynamic expansion operations in the application through the target interface, while also preventing the plug-in from affecting the stable operation of the application when it is dynamically expanded, and avoiding the problem of interference with the original program of the application when the plug-in is dynamically expanded.

[0159] Example 2: Please refer to Figure 3 As shown, the part not described in detail in this embodiment is described in the first embodiment, and a dynamic plug-in extension method based on xml-pull is provided, which is applied to the extension platform and implemented by a dynamic plug-in extension system based on xml-pull, including:

[0160] S1: extract the basic information of the plug-in, filter out the plug-in features from the basic information, the plug-in features include dependency features, compatibility features, format features and license features, and construct the plug-in features into an XML file based on the file construction criteria;

[0161] S2: Obtain the extended attributes of the XML file, which include type value and form value, calculate the demand coefficient of the XML file, and determine whether the dynamic extension requirement is met;

[0162] S3: If the dynamic expansion requirements are met, the attribute status of the application program interface is identified one by one, the attribute status includes busy interface and idle interface, and the extensible interface is selected from the interface according to the attribute status;

[0163] S4: Obtain extended parameters of the extensible interface, which include the number of concurrent requests, effective response time, and error ratio. According to the extended parameters, calculate the expansion coefficient of the extensible interface, and select the target interface from the extensible interface.

[0164] S5: Import the XML file into the application through the target interface, parse the XML file based on the XML-pull parser, and control the dynamic expansion of the plug-in.

[0165] Example 3: Please refer to Figure 4 As shown, this embodiment discloses an electronic device, including a processor and a memory;

[0166] Wherein, the memory stores a computer program that can be called by the processor;

[0167] The processor executes and implements the xml-pull-based dynamic plug-in expansion method by calling the computer program stored in the memory.

[0168] Since the electronic device introduced in this embodiment is an electronic device used to implement the dynamic plug-in expansion method based on xml-pull in the second embodiment of this application, based on the dynamic plug-in expansion method based on xml-pull introduced in the embodiment of this application, the technical personnel of this field can understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of this application is not introduced in detail here. As long as the technical personnel of this field implement the electronic device adopted by the dynamic plug-in expansion method based on xml-pull in the embodiment of this application, it belongs to the scope of protection of this application.

[0169] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A dynamic plug-in extension system based on xml-pull, applied to the extension platform, characterized by: include: A file construction module is used to extract basic information of the plug-in, filter out plug-in features from the basic information, the plug-in features include dependency features, compatibility features, format features and license features, and construct the plug-in features into an XML file based on the file construction criteria; The demand determination module is used to obtain the extended attributes of the XML file, the extended attributes include type value and form value, calculate the demand coefficient of the XML file, and determine whether the dynamic expansion demand is met; The methods for obtaining type and form values ​​include: Query i attribute information of the XML file through the technical parameter table, and mark the attribute words of the i attribute information one by one, and record the attribute information whose attribute words are type and form as first information and second information respectively; The construction time of all the first information and the second information is queried one by one through the timestamp, and the construction time is arranged one by one in the order of time to generate the first arrangement row and the second arrangement row; The first information with the same construction time in the first arrangement row is recorded as type information, and the number of type information is counted to obtain the type value; Record the second information without the same construction time in the second arrangement row as form information, and count the number of form information to obtain the form value; The expression of demand coefficient is: ; In the formula, is the demand coefficient of the xml file, The type value of the XML file. It is the formal value of the XML file; The interface screening module is used to identify the attribute status of the application program interface one by one, the attribute status includes busy interface and idle interface, and screen out the extensible interface from the interface according to the attribute status; The coefficient calculation module is used to obtain the extended parameters of the extensible interface, which include the number of concurrent requests, the effective response time and the error ratio. According to the extended parameters, the expansion coefficient of the extensible interface is calculated, and the target interface is selected from the extensible interface. Methods for obtaining the error ratio value include: Take the current time as the starting point and work backwards for a preset return cycle to generate a request tracing period; Use system monitoring tools to query one by one An extensible interface collects all return requests within the request tracing period, marks the status boxes of all return requests one by one, and identifies the status values ​​in the status boxes; The status box with a status value of 1 is recorded as an error box, the return request corresponding to the error box is recorded as an error request, and the number of error requests is counted to obtain Error value; Count one by one The total number of requests returned by the extensible interface, The total value of the request, and The error values ​​are Compare the total value of requests and get The error percentage value; The expression of error ratio is: ; In the formula, For the The error ratio of the extensible interface, For the The error value of the extensible interface, For the The total value of requests for extensible interfaces; The expression of the expansion factor is: ; In the formula, For the The expansion factor of the extensible interface, For the The number of concurrent requests for the extensible interface, For the The effective response time of an extensible interface, , , is a weight factor greater than 0; The dynamic extension module is used to import XML files into the application through the target interface, parse the XML files based on the XML-pull parser, and control the dynamic extension of the plug-in.

2. The xml-pull-based dynamic plug-in expansion system according to claim 1, characterized in that: The screening methods for dependency features, compatibility features, format features, and licensing features include: Query the comprehensive information of the plug-in through the information management system, mark the identity remark boxes of the comprehensive information one by one, and identify the remark words in the identity remark boxes; The identity remark box with the remark word "plugin" is recorded as the basic remark box, and the comprehensive information corresponding to the basic remark box is recorded as the basic information; Through natural language processing technology, the key semantics of basic information are identified one by one, and the key semantics are split to obtain text semantics and digital semantics; The key semantics with textual semantics of dependency, compatibility, format and permission are recorded as dependency semantics, compatibility semantics, format semantics and permission semantics respectively, and the dependency semantics, compatibility semantics, format semantics and permission semantics are combined with the corresponding digital semantics head and tail to generate dependency features, compatibility features, format features and permission features.

3. The xml-pull-based dynamic plug-in expansion system according to claim 2, characterized in that: The file construction criteria are: only one plug-in feature is included in a feature position; The construction methods of xml files include: A blank basic file is constructed by using a file construction tool, and four feature bits arranged in a straight line are sequentially drawn in the basic file; In a manner from front to back, the four characteristic bits are numbered in ascending order to obtain a first characteristic bit, a second characteristic bit, a third characteristic bit and a fourth characteristic bit; Marking file association points at both ends of the first feature bit, the second feature bit, the third feature bit and the fourth feature bit respectively, and establishing an association channel between two adjacent file association points; The dependent features, compatible features, format features and permission features are imported into the first feature bit, the second feature bit, the third feature bit and the fourth feature bit one by one to generate an XML file.

4. The xml-pull-based dynamic plug-in expansion system according to claim 3, characterized in that: Methods for determining whether dynamic expansion requirements are met include: The requirement coefficient of the xml file With the preset demand threshold Compare; when Greater than or equal to When , it is determined that the dynamic expansion requirements are met; when Less than , it is determined that the dynamic expansion requirement is not met.

5. The xml-pull-based dynamic plug-in expansion system according to claim 4, characterized in that: Methods for identifying busy interfaces and idle interfaces include: Query the work logs of the p interfaces of the application program one by one through the database, and mark the status indicator columns from the work logs to obtain p status indicator columns; Identify the potential values ​​in the p status indicator columns one by one, and count the number of all potential values ​​to obtain p total values; Count the number of potential values ​​0 in p status indicator columns one by one to obtain p working low-level values; When the working low value of the interface is greater than or equal to two-thirds of the total value, the attribute state of the interface is recorded as an idle interface; When the working low value of the interface is less than two-thirds of the total value, the attribute state of the interface is recorded as a busy interface; The screening methods of the extensible interface include: When the attribute status of the interface is busy, the interface is not recorded as an extensible interface; When the interface attribute of the interface is busy, the interface is recorded as an extensible interface. An extensible interface.

6. The xml-pull-based dynamic plug-in expansion system according to claim 5, characterized in that: Methods for obtaining effective response time include: Through the log management system, we can query The historical operation log of an extensible interface is obtained by marking the execution request in the historical operation log. Execute requests; Query one by one by timestamp The receiving time and execution time of the execution request are recorded as the sub-duration, and the Length of time; Will After accumulating the duration of each sub-item, we find the average value. Effective response time; The expression of effective response time is: ; In the formula, For the The first extensible interface The length of the child.

7. The xml-pull-based dynamic plug-in expansion system according to claim 6, characterized in that: The parsing methods of xml files include: Switch the working state of the target interface to the on state, import the XML file into the target interface of the application, and switch the working state of the target interface to the off state; Mark the first and last information bits in the XML file as the parsing start and end points; Introduce the xml-pull parser into the application, and read and parse the information in the xml file in the order from the parsing start point to the parsing end point until the xml file is completely parsed.

8. A dynamic plug-in extension method based on xml-pull, applied to an extension platform, implemented based on a dynamic plug-in extension system based on xml-pull according to any one of claims 1 to 7, characterized in that: include: S1: extract the basic information of the plug-in, filter out the plug-in features from the basic information, the plug-in features include dependency features, compatibility features, format features and license features, and construct the plug-in features into an XML file based on the file construction criteria; S2: Obtain the extended attributes of the XML file, which include type value and form value, calculate the demand coefficient of the XML file, and determine whether the dynamic expansion demand is met; S3: If the dynamic expansion requirements are met, the attribute status of the application program interface is identified one by one, the attribute status includes busy interface and idle interface, and the extensible interface is selected from the interface according to the attribute status; S4: Obtain extended parameters of the extensible interface, which include the number of concurrent requests, effective response time, and error ratio. According to the extended parameters, calculate the expansion coefficient of the extensible interface, and select the target interface from the extensible interface. S5: Import the XML file into the application through the target interface, parse the XML file based on the XML-pull parser, and control the dynamic expansion of the plug-in.

Citation Information

Patent Citations

  • Extensible plug-in system, method and equipment and storage medium

    CN118484244A

  • Remote sensing image processing system based on plug-in extensible architecture

    CN112445497A

  • Binary component retrieval method and device

    CN116804980A