Component library construction and calling method and device, equipment and storage medium

By generating composite and business components, building component libraries, and calling components according to the functional requests of client applications, the problems of low efficiency in building component libraries and difficult client scheduling are solved, and the response speed and user experience are improved.

CN118897675APending Publication Date: 2024-11-05CHINA MERCHANTS BANK
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411222260.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

The component style and interaction logic of mainstream open source component libraries differ from the design specifications of banking enterprise apps, resulting in low efficiency in building component libraries and difficult client scheduling, requiring a lot of duplicate code to be written, and insufficient encapsulation.

Method used

By obtaining the basic components, generating composite components and business components, building component libraries, and determining the components to be used based on the functional requests of the client application, calling the corresponding components in the component library to send them to the request page of the client application.

Benefits of technology

It improves the efficiency of component library construction, reduces the difficulty of client calling component library, improves response speed and user experience, and overcomes the technical shortcomings of low efficiency of component library construction and high difficulty of client scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118897675A_ABST
    Figure CN118897675A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of component library construction, and discloses a component library construction and calling method and device, equipment and a storage medium, and the method comprises the steps: obtaining a basic component, and generating a composite component and a business component according to the basic component; constructing a component library according to the basic component, the composite component and the business component; in response to a function request of a client application, determining a to-be-used component based on the function request; and calling a corresponding component in the component library according to the to-be-used component, and sending the corresponding component in the component library to a request page of a client application. The construction efficiency of the component library can be effectively improved, and the difficulty of calling the component library by the client is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of component library construction, and in particular to a component library construction and calling method, device, equipment and storage medium. Background Art

[0002] The styles and interaction logic of components in mainstream open source component libraries are somewhat different from the design specifications of bank enterprise apps. In order to better adapt to various products, the components of open source component libraries are more flexible. Correspondingly, in the actual development process, a large amount of repeated code still needs to be written, and the encapsulation is insufficient. Mainstream open source component libraries are mainly built based on pure H5 scenarios, lacking integration with client native capabilities, resulting in low component library construction efficiency and difficulty in client scheduling.

[0003] Therefore, how to effectively improve the efficiency of component library construction and effectively reduce the difficulty of clients calling component libraries is a problem that needs to be solved urgently.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a component library construction and calling method, device, equipment and storage medium, aiming to solve the technical problem of how to effectively improve the efficiency of component library construction and effectively reduce the difficulty of client calling component library.

[0006] To achieve the above purpose, the present application proposes a component library construction and calling method, the method comprising:

[0007] Obtain basic components, and generate composite components and business components based on the basic components;

[0008] Building a component library according to the basic component, the composite component and the business component;

[0009] In response to a function request of a client application, determining a component to be used based on the function request;

[0010] The corresponding component in the component library is called according to the component to be used, and the corresponding component in the component library is sent to the request page of the client application.

[0011] In one embodiment, the obtaining of basic components and generating composite components and business components according to the basic components includes:

[0012] Obtaining business requirements, and extracting common functions according to the business requirements, wherein the functions at least include data entry function, interaction function, feedback function, navigation function and data display function;

[0013] Generate the basic component according to the general function;

[0014] Combining the basic components to generate a composite component;

[0015] The business logic is obtained, and a business component is generated according to the business logic and the composite component.

[0016] In one embodiment, the building of a component library according to the basic component, the composite component and the business component includes:

[0017] Performing integration testing on the basic components, the composite components and the business components to obtain qualified components;

[0018] Acquire a style variable and an interface variable, and associate the style variable and the interface variable with the qualified component respectively to obtain the associated qualified component;

[0019] A component library is constructed according to the associated qualified components.

[0020] In one embodiment, performing integration testing on the basic component, the composite component, and the business component to obtain a qualified component includes:

[0021] Performing functional tests on the basic component, the composite component and the business component respectively to obtain functional test results;

[0022] Performing compatibility tests on the basic component, the composite component and the business component respectively to obtain compatibility test results, wherein the compatibility test at least includes operating system compatibility, device compatibility and application version compatibility;

[0023] Qualified components are determined according to the functional test results and the compatibility test results.

[0024] In one embodiment, determining a qualified component according to the functional test result and the compatibility test result includes:

[0025] When both the functional test result and the compatibility test result are tested passed, determining the corresponding basic components, composite components and business components as the basic components that passed the test, the composite components that passed the test and the business components that passed the test;

[0026] Qualified components are obtained according to the basic components that have passed the test, the composite components that have passed the test, and the business components that have passed the test.

[0027] In one embodiment, calling a corresponding component in the component library according to the component to be used, and sending the corresponding component in the component library to a request page of a client application includes:

[0028] Perform component matching on the component library according to the component to be used to obtain the corresponding component in the component library;

[0029] Obtaining the interface variable of the corresponding component;

[0030] The corresponding component is called according to the interface variable, and the corresponding component is sent to the request page of the client application.

[0031] In one embodiment, matching the component library according to the component to be used to obtain the corresponding component in the component library includes:

[0032] Obtaining the properties of the component to be used;

[0033] According to the matching of the attribute of the component to be used with the attribute of each component in the component library, the attribute matching degree between the component to be used and each component in the component library is obtained;

[0034] Determining matching components according to the attribute matching degree;

[0035] When there are multiple matching components, determining a target component among the multiple matching components according to a preset priority rule;

[0036] The target component is used as a corresponding component in a component library.

[0037] In addition, to achieve the above purpose, the present application also proposes a component library construction and calling device, the component library construction and calling device comprising:

[0038] A generation module, used to obtain basic components and generate composite components and business components based on the basic components;

[0039] A construction module, used to construct a component library according to the basic component, the composite component and the business component;

[0040] A determination module, configured to respond to a function request of a client application and determine a component to be used based on the function request;

[0041] The calling module is used to call the corresponding component in the component library according to the component to be used, and send the corresponding component in the component library to the request page of the client application.

[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a component library construction and calling device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the component library construction and calling method as described above.

[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the component library construction and calling method described above are implemented.

[0044] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the component library construction and calling method described above are implemented.

[0045] The present application provides a component library construction and calling method. The present application first obtains basic components, and generates composite components and business components based on the basic components; constructs a component library based on the basic components, the composite components and the business components; responds to a function request of a client application, and determines a component to be used based on the function request; calls a corresponding component in the component library according to the component to be used, and sends the corresponding component in the component library to a request page of the client application, thereby effectively improving the efficiency of component library construction and effectively reducing the difficulty of the client calling the component library.

[0046] In summary, the present application quickly builds a comprehensive component library by generating composite components and business components based on basic components, and then quickly and efficiently responds to the functional requests of client applications, calls components in the component library according to the functional requests and sends the components to the request page of the client application, thereby improving the response speed and user experience, overcoming the technical defects of low component library construction efficiency and high client scheduling difficulty, and can effectively improve the component library construction efficiency and effectively reduce the difficulty of the client calling the component library. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0049] Figure 1 A flowchart of the first embodiment of the component library construction and calling method of the present application is provided;

[0050] Figure 2 A hierarchical schematic diagram of a component library provided in Embodiment 1 of the component library construction and calling method of the present application;

[0051] Figure 3 A schematic diagram of a design document provided for the first embodiment of the component library construction and calling method of the present application;

[0052] Figure 4 A schematic diagram of the overall architecture of a component library provided in Embodiment 1 of the component library construction and calling method of the present application;

[0053] Figure 5 A flowchart of the second embodiment of the component library construction and calling method of the present application is provided;

[0054] Figure 6 A schematic diagram of the module structure of a component library construction and calling device according to an embodiment of the present application;

[0055] Figure 7 A schematic diagram of the device structure of the hardware operating environment involved in the component library construction and calling method of the embodiment of the present application.

[0056] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0057] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0058] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0059] The main solution of the embodiment of the present application is: obtain basic components, and generate composite components and business components based on the basic components; build a component library based on the basic components, the composite components and the business components; respond to the function request of the client application, and determine the component to be used based on the function request; call the corresponding component in the component library according to the component to be used, and send the corresponding component in the component library to the request page of the client application.

[0060] The styles and interaction logic of components in mainstream open source component libraries are somewhat different from the design specifications of bank enterprise apps. In order to better adapt to various products, the components of open source component libraries are more flexible. Correspondingly, in the actual development process, a large amount of repeated code still needs to be written, and the encapsulation is insufficient. Mainstream open source component libraries are mainly built based on pure H5 scenarios, lacking integration with client native capabilities, resulting in low component library construction efficiency and difficulty in client scheduling. Therefore, how to effectively improve the efficiency of component library construction and effectively reduce the difficulty of client calling component libraries is a problem that needs to be solved urgently.

[0061] The present application quickly builds a comprehensive component library by generating composite components and business components based on basic components, and then quickly and efficiently responds to functional requests of client applications, calls components in the component library according to functional requests and sends the components to the request page of the client application, thereby improving response speed and user experience, overcoming the technical defects of low component library construction efficiency and high client scheduling difficulty, and can effectively improve the component library construction efficiency and effectively reduce the difficulty of client calling component library.

[0062] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a component library construction and calling device, etc. The following takes the component library construction and calling device as an example to illustrate this embodiment and the following embodiments.

[0063] Based on this, the present application embodiment provides a component library construction and calling method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the component library construction and calling method of the present application.

[0064] In this embodiment, the component library construction and calling method includes steps S10 to S40:

[0065] Step S10, taking basic components, and generating composite components and business components according to the basic components.

[0066] It should be noted that basic components refer to components with general functions and simple interfaces. They are usually used to build more complex components or directly used in business scenarios. By combining and extending basic components, composite components and business components can be generated. Composite components refer to components with specific functions and interfaces composed of multiple basic components, while business components are components customized for specific business scenarios. They can contain composite components or be directly composed of basic components and contain certain business logic and business data. In the process of generating composite components and business components, technical means such as templating and parameterization can be used to improve the reusability and flexibility of components.

[0067] It is understandable that the basic components may include data entry components, interactive components, feedback components, navigation components, and data display components. Data entry components are components used to collect and enter data, such as input boxes, date selection boxes, forms, etc. Data entry components can be used to collect various information from users. Data entry components are very important for collecting and entering user information. When designing, factors such as input validation, error prompts, user experience, and accessibility need to be fully considered in order to provide high-quality data entry functions. Interactive components are components used to interact with users, such as buttons, radio buttons, list shuttle boxes, check boxes, drop-down boxes, switches, etc. Interactive components can be used to implement various interactive functions, such as opening a new page, displaying detailed information, submitting a form, expanding and collapsing, etc. Interactive components are very important for implementing various interactive functions. When designing, factors such as user experience, ease of use, and compatibility need to be fully considered in order to provide easy-to-use interactive functions. Feedback components are components used to provide feedback information to users, such as message boxes, dialog boxes, prompt boxes, etc. Feedback components can be used to provide users with status information, operation results, error prompts, loading progress and other feedback information, so that users can better understand and grasp the page status and operation results. The main function of the navigation component is to help users quickly find the required page or function, such as menus, paging, tree navigation, etc. The main function of the data display component is to present data to users in a visual way, such as tables, lists, relationship diagrams, etc.

[0068] In the specific implementation, the basic types of components that the component library will include are confirmed according to the bank's corporate App design specifications. Based on the specific functions and usage scenarios of the components and the actual usage of multiple business functions, composite components and service suites are generated. The service suite is the business component, which includes background requests and may be a sub-process in a function, such as face recognition, electronic signing, digital signature, etc.

[0069] In a feasible implementation, step S10 may include: obtaining business requirements, extracting common functions based on the business requirements, wherein the functions include at least data entry function, interaction function, feedback function, navigation function and data display function; generating the basic components based on the common functions; generating composite components by combining the basic components; obtaining business logic, and generating business components based on the business logic and the composite components.

[0070] It should be noted that for banking enterprises, business needs may include but are not limited to account management, transfer, payment, loan application, etc.; for e-commerce platforms, business needs may include product browsing, shopping cart management, order processing, user comments, etc.; for social media platforms, business needs may include user information management, friend interaction, message notification, content publishing, etc. This embodiment takes banking business needs as an example for explanation.

[0071] It is understandable that for banking business needs, the banking business process is analyzed to identify core business scenarios, such as account management, transfer, payment, etc. Based on the core business scenarios, general functional requirements are extracted. For example, in the account management scenario, data entry functions may be required to add or modify account information, interactive functions to implement account query and operation, feedback functions to notify users of operation results, navigation functions to guide users to switch between different account management functions, and data display functions to display account balances and transaction records. Based on the extracted general functional requirements, basic components are designed and implemented, including building data entry components based on data entry functions, such as input boxes, date selection boxes, forms, etc.; building interactive components based on interactive functions, such as buttons, radio buttons, list shuttle boxes, check boxes, drop-down boxes, switches, etc.; building feedback components based on feedback functions, such as message boxes, dialog boxes, prompt boxes, etc.; building navigation components based on navigation functions, such as menus, paging, tree navigation, etc.; building data display components based on data display functions, such as tables, lists, relationship diagrams, etc.

[0072] It can be understood that basic components can be used to generate composite components through combination and customization. For example, a composite component can be created to implement a complete form submission process. The composite component can include data entry components (such as input boxes, date selection boxes), interactive components (such as submit buttons, reset buttons) and feedback components (such as success prompt boxes, error prompt boxes). In this way, developers can quickly build a form processing process that meets specific business needs without having to write code from scratch.

[0073] It is worth mentioning that business components are generated according to business logic. Taking banking business as an example, a business component dedicated to transfer operations can be created. This business component not only contains basic components and composite components, but also encapsulates transfer-related business logic, such as verifying transfer amount, checking account balance, processing transfer results, etc. In this way, developers can encapsulate complex business logic in one component to simplify the implementation process of business scenarios.

[0074] Step S20, constructing a component library according to the basic component, the composite component and the business component.

[0075] It should be noted that the component library is a resource library that centrally stores and manages various components. It not only includes basic components, composite components and business components, but also provides component classification, retrieval and version management functions. The construction process of the component library needs to follow certain specifications and standards to ensure the universality and reusability of the components.

[0076] It is understandable that in the process of building a component library, basic components, generated composite components and business components are classified and stored. The classification can be based on standards such as component functions, usage scenarios or business requirements to facilitate subsequent rapid retrieval and calling.

[0077] It is worth noting that when building a component library, each component needs to be defined in detail, including its properties, methods, events, and styles. The component library should have good modularity and scalability to facilitate subsequent maintenance and upgrades. In addition, the component library should also provide a unified interface specification to ensure smooth interaction between components.

[0078] In the specific implementation, the component library is divided into three levels. The first level is basic components, which refer to atomic-level components that do not contain business logic, have single functions, and are highly versatile, such as buttons, toasts, navigation bars, etc. The first level is composite components, which are a collection of multiple basic components and contain relatively responsible front-end interaction logic, such as approval opinion input boxes, bank lists, user lists, etc. The last level is the service suite, that is, business components, which include background requests and may be a sub-process in a function, such as face recognition, electronic signing, etc. Figure 2 As shown, Figure 2 A hierarchical diagram of the component library.

[0079] Step S30, in response to a function request of the client application, determining a component to be used based on the function request.

[0080] It should be noted that in client applications, function requests are usually triggered by user operations, such as inputting an amount and selecting a payment method when making a payment. These requests are sent to the server through the client application, and the server determines the components to be used based on the request content. In order to achieve this process, it is necessary to embed the interface of the component library in the client application so that the corresponding components can be quickly retrieved and called from the component library when a function request occurs.

[0081] In a specific implementation, the functional request of the client application is parsed to determine the specific content and target of the request, and the component type to be used and its parameters are determined according to the request content.

[0082] Step S40: calling a corresponding component in the component library according to the component to be used, and sending the corresponding component in the component library to a request page of the client application.

[0083] It should be noted that the component library's retrieval mechanism can be used to find the corresponding component in the component library according to the component to be used. The component library's retrieval mechanism can be matched based on the component's name, function description, usage scenario and other information to ensure that the required corresponding component can be found quickly and accurately. After determining the corresponding component, the component library will return relevant information about the corresponding component, including the component's properties, methods, events, and styles. Based on this information, the client application dynamically loads and renders the component to ensure the immediate response and interactivity of the user interface, including the instantiation, configuration, and binding of the component to the data stream of the client application so that the component can correctly display data and respond to user operations.

[0084] It is worth noting that the component types of the component library are confirmed according to the design specifications, and detailed design documents are generated, including but not limited to component properties, methods, custom styles, etc. At the same time, it is necessary to confirm whether it involves the call of client device capabilities. Generate code for each component according to the design document. When generating code, pay attention to the availability, scalability and maintainability of the components. Components involving calls to client native capabilities need to cover multiple devices, multiple operating systems, and multiple App versions to ensure the reliability and stability of the components. You can also write usage documents for each component, including component functions, usage methods, applicable scenarios, code structure, etc., and use dumi to provide a real-time preview effect for each component.

[0085] like Figure 3 As shown, Figure 3As a design document diagram, the amount input box is a composite component. The component properties include: clearable is whether the content of the input box can be cleared, and the default value is false; defaultValue is the initial value of the input box; disabled is whether the input box is disabled, and the default value is false; ld is the component identifier; formatType is the input format type, such as date, number, etc.; onChange is the callback function when the input value changes, receiving the new value as a parameter; onClear is the callback function when the input box is cleared. The external methods provided by the amount input box include: blur() is used to move the focus away from the current element. In TypeScript, the correct return type should be void, indicating that this method does not return any value; clear() is used to clear the content of the input box or some other states. Similarly, if this method has no return value, its return type should be void; focus() is used to set the focus to the current element, usually to allow the user to start entering data, and its return type is also void. The client native capabilities involved include obtaining the height of the device navigation bar.

[0086] In a feasible implementation, step S40 includes: matching the component library according to the component to be used to obtain the corresponding component in the component library; obtaining the interface variable of the corresponding component; calling the corresponding component according to the interface variable, and sending the corresponding component to the request page of the client application.

[0087] It should be noted that during the component matching process, the component library's retrieval mechanism will use advanced algorithms, such as fuzzy matching and semantic analysis, to improve the accuracy and flexibility of retrieval. In addition, the component library can also self-optimize based on historical usage data and user feedback to continuously improve retrieval results.

[0088] It is understandable that when the component is successfully matched, it is determined that calling the component involves calling the capabilities of the client device. For example, when calling the amount input box, the client's native amount keyboard needs to be used instead of the virtual keyboard. If the capabilities of the client device need to be used when calling the component, the corresponding interface variables are obtained, and the corresponding device capabilities are called according to these interface variables. For example, the camera component of the client device needs to be called through the camera interface; the keyboard component of the client device needs to be called through the keyboard interface. After obtaining the interface variables, the system will call the corresponding device capabilities according to the interface specifications provided by the component library to ensure that the component can run normally in the client application.

[0089] like Figure 4 As shown, Figure 4This is a schematic diagram of the overall architecture of the component library. The overall architecture of the component library includes the component layer, interface layer and platform layer. The component layer mainly deals with UI style and interaction logic. The interface layer mainly includes abstract methods of client device capabilities. The platform layer is the specific implementation of client device capabilities by various platform products. The component layer includes OCR (text recognition) components, keyboard components, camera components, and image download components, etc. The interface layer includes camera interface, keyboard interface, download interface, face recognition interface, etc. The platform layer includes bank enterprise apps, enterprise assistant applets and other corporate mobile products.

[0090] In the specific implementation, after the component is sent to the request page of the client application, the client application will dynamically load and render according to the component's properties, methods, events, styles and other information to achieve instant display and interaction of the component. In order to further optimize the user experience, the client application can also dynamically adjust the component loading strategy according to the device's performance and network conditions. For example, in the case of poor network conditions, the client application can prioritize loading the core functions of the component to ensure that users can use the basic functions of the component as soon as possible; in the case of good network conditions, more component details and special effects can be loaded to provide a richer user experience.

[0091] It is worth noting that when sending the corresponding component to the request page of the client application, an efficient transmission protocol is used to ensure that the component can be loaded quickly. In addition, the network conditions and the performance of the client device are also considered to optimize the loading speed and operating efficiency of the component. For example, in the case of poor network conditions, the system can use an offline caching mechanism to pre-store commonly used components on the client device, thereby improving the user experience.

[0092] In a feasible implementation manner, the component library is matched with the component to be used to obtain the corresponding component in the component library, including: obtaining the attribute of the component to be used; matching the attribute of the component to be used with the attribute of each component in the component library to obtain the attribute matching degree between the component to be used and each component in the component library; determining the matching component according to the attribute matching degree; when there are multiple matching components, determining the target component among the multiple matching components according to a preset priority rule; and using the target component as the corresponding component in the component library.

[0093] It should be noted that the attribute matching degree is an indicator of the similarity between the component to be used and the components in the component library. In order to calculate the attribute matching degree, a variety of methods can be used, such as a weight-based scoring system. Each attribute can be assigned a weight value, indicating the importance of the attribute in the matching process. For example, for the amount input box component, attributes such as "formatType" and "onChange" may have a higher weight because they directly affect the function and behavior of the component. When calculating the attribute matching degree, all attributes of the component to be used will be traversed and compared with the corresponding attributes of each component in the component library. For each matching attribute, the system will calculate the score according to its weight and add it to the total score, and determine the most matching component according to the total score. If there are multiple components with the same or similar scores, they will be selected according to the preset priority rules. These rules can be based on factors such as the frequency of use of the component, performance, user feedback, etc. For example, if a component has been stable in past use and has good user feedback, it may be given a higher priority. In addition, the most suitable component version can be selected according to the type of client device and the operating system version. This embodiment does not impose specific restrictions on this.

[0094] It is worth noting that in terms of component library maintenance, components need to be updated and optimized regularly. The use of component libraries can also be combined with micro-frontend architecture to load and manage components in the component library as independent micro-frontend modules, which can not only improve the reusability of components, but also realize modular development and deployment of applications, further improving development efficiency and application maintainability.

[0095] The present embodiment provides a component library construction and calling method. The present embodiment first obtains basic components, and generates composite components and business components based on the basic components; constructs a component library based on the basic components, the composite components and the business components; responds to a function request of a client application, and determines a component to be used based on the function request; calls a corresponding component in the component library according to the component to be used, and sends the corresponding component in the component library to a request page of the client application. This can effectively improve the efficiency of component library construction and effectively reduce the difficulty of the client calling the component library.

[0096] In summary, this embodiment quickly builds a comprehensive component library by generating composite components and business components based on basic components, and then quickly and efficiently responds to functional requests of client applications, calls components in the component library according to functional requests and sends the components to the request page of the client application, thereby improving response speed and user experience, overcoming the technical defects of low component library construction efficiency and high client scheduling difficulty, and can effectively improve the component library construction efficiency and effectively reduce the difficulty of the client calling the component library.

[0097] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 5 , the step S20 further includes steps S201-S203:

[0098] Step S201, performing integration testing on the basic components, the composite components and the business components to obtain qualified components.

[0099] It should be noted that the purpose of integration testing is to ensure that the various components can work together properly when used in combination to avoid functional and compatibility issues.

[0100] It is understandable that integration testing includes both functional testing and compatibility testing results. Functional testing mainly checks whether the components can achieve the expected functions when used in combination, while compatibility testing ensures that the components can run normally in different environments and platforms without conflicts or incompatibility issues.

[0101] In a feasible implementation, step S201 may include: performing functional tests on the basic components, the composite components and the business components respectively to obtain functional test results; performing compatibility tests on the basic components, the composite components and the business components respectively to obtain compatibility test results, wherein the compatibility tests include at least operating system compatibility, device compatibility and application version compatibility; and determining qualified components based on the functional test results and the compatibility test results.

[0102] It should be noted that functional testing and compatibility testing of basic components, composite components, and business components can ensure the stability and reliability of each component when used independently and in combination. Through this step-by-step testing method, potential problems can be effectively identified and resolved, thereby improving the quality and usability of the entire component library.

[0103] It is understood that compatibility testing includes at least operating system compatibility, device compatibility, and application version compatibility, among which operating system compatibility refers to whether a component can run normally on different operating system versions, device compatibility refers to whether a component can run normally on different types of devices, and application version compatibility refers to whether a component can run normally on different versions of applications. Comprehensive compatibility testing can ensure that components in the component library can maintain good performance and stability in various environments.

[0104] In the specific implementation, for example, the amount input box is functionally tested, including whether the content input by the amount keyboard is displayed normally on the component and whether clicking the clear button can clear it with one click; the amount input box is tested for operating system compatibility to determine whether the component can be used normally on operating systems such as Android, IOS, and Hongmeng; the amount input box is tested for device compatibility to determine whether the component can be used normally on models such as Huawei, Xiaomi, and Apple; the amount input box is tested for application version compatibility to determine whether the component can be used normally on versions such as bank enterprise App 6.0.0, 6.1.0, etc., where the bank in this embodiment may be China Merchants Bank, and this embodiment does not impose any specific restrictions on this.

[0105] In a feasible implementation manner, determining qualified components based on the functional test results and the compatibility test results includes: when the functional test results and the compatibility test results are both passed, determining the corresponding basic components, composite components and business components as the basic components that passed the test, the composite components that passed the test and the business components that passed the test; and obtaining qualified components based on the basic components that passed the test, the composite components that passed the test and the business components that passed the test.

[0106] It should be noted that if a component passes both the functional test and the compatibility test, it can be considered qualified and can be included in the component library for use by client applications. Through this hierarchical screening mechanism, it can be ensured that each component in the component library has been rigorously tested, thereby improving the stability and reliability of the entire system.

[0107] It is worth noting that in the process of determining qualified components, a hierarchical screening mechanism can be used to ensure that each component meets the established quality standards. First, the basic components are screened, and only components that pass the functional test and compatibility test can enter the next step of composite component and business component testing. For composite components, in addition to meeting the test standards of basic components, it is also necessary to verify whether the combined functions are normal. For business components, in addition to the test standards of basic components and composite components, it is also necessary to ensure their compatibility with business logic.

[0108] In specific implementation, automated testing tools can be used to improve testing efficiency. For example, use Selenium for functional testing, use Appium for mobile device compatibility testing, and use JMeter for performance testing. Through automated testing, a large number of components can be tested quickly, thereby shortening the construction cycle of the entire component library. In order to further improve the quality of the component library, HIA can introduce a continuous integration (CI) mechanism. Under the CI mechanism, each code submission will trigger an automated testing process to ensure that newly submitted components or code modifications will not have a negative impact on the existing component library. Through continuous integration, problems can be discovered and fixed in a timely manner, thereby ensuring the stability and reliability of the component library.

[0109] Step S202, acquiring style variables and interface variables, and associating the style variables and the interface variables with the qualified components respectively, to obtain the associated qualified components.

[0110] It should be noted that style variables refer to parameters that affect the appearance and layout of components, including size, color, font, etc. By formulating a unified style variable design token in the component library, the consistency of components can be ensured. Interface variables define the way components interact with the outside world, including data input and output formats, event processing, etc. Associating these variables with qualified components can make components more flexible and configurable to meet the needs of different application scenarios.

[0111] It is understandable that style variables and interface variables are associated with qualified components by writing configuration files or using specific configuration tools. The configuration files describe the style variables and interface variables of each component in detail. For example, for a button component, style variables may include the background color, border style, text color, etc. of the button, while interface variables may include the callback function of the button click event, parameters passed to the callback function, etc. By associating these variables with the button component, developers can easily implement buttons of different styles and functions without modifying the component itself.

[0112] Step S203: construct a component library according to the associated qualified components.

[0113] It should be noted that the process of building a component library is a systematic and structured process, which aims to organize qualified components that have been rigorously tested into a collection that is easy to manage and use. When building a component library, it is necessary to classify and organize the associated qualified components to ensure that each component has a clear identification and description for developers to find and use.

[0114] In the specific implementation, qualified components are classified according to their functions and uses. For example, input boxes, buttons, lists, cards, etc. are classified into different categories. Classification helps improve the maintainability and scalability of the component library. Write detailed documentation for each component, including how to use the component, configuration instructions for style variables and interface variables, compatibility information, etc. Documentation is an indispensable part of the component library and helps developers quickly understand and apply components. Provide usage examples for each component, including code snippets and running effect demonstrations. Examples can help developers better understand the usage scenarios and effects of components and improve development efficiency. Manage the versions of components in the component library to ensure that each version of the component has a clear change record and upgrade guide. Version management helps track the update history of components and facilitates developers to choose the appropriate version for development. Publish the built component library to an internal or external resource library for developers to download and use. During the publishing process, it is necessary to ensure that the installation and integration process of the component library is simple and easy to reduce the threshold for developers to use. Regularly maintain and update the component library, including fixing known issues, adding new components, and optimizing existing components.

[0115] In this embodiment, by performing integration testing on components, stable and reliable qualified components can be determined, and then the qualified components can be associated with style variables and interface variables to make the components more flexible and configurable. Then, a component library can be built based on the associated components, which can effectively improve the stability, reliability and flexibility of the component library.

[0116] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the component library construction and calling method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0117] This application also provides a component library construction and calling device, please refer to Figure 6 , the component library construction and calling device includes:

[0118] The generation module 10 is used to obtain basic components and generate composite components and business components according to the basic components.

[0119] The construction module 20 is used to construct a component library according to the basic component, the composite component and the business component.

[0120] The determination module 30 is used to respond to a function request of a client application and determine a component to be used based on the function request.

[0121] The calling module 40 is used to call the corresponding component in the component library according to the component to be used, and send the corresponding component in the component library to the request page of the client application.

[0122] The present embodiment provides a component library construction and calling device. The present embodiment obtains basic components, and generates composite components and business components based on the basic components; constructs a component library based on the basic components, the composite components and the business components; responds to a function request of a client application, and determines a component to be used based on the function request; calls a corresponding component in the component library based on the component to be used, and sends the corresponding component in the component library to a request page of the client application, which can effectively improve the efficiency of component library construction and effectively reduce the difficulty of the client calling the component library.

[0123] In summary, this embodiment quickly builds a comprehensive component library by generating composite components and business components based on basic components, and then quickly and efficiently responds to functional requests of client applications, calls components in the component library according to functional requests and sends the components to the request page of the client application, thereby improving response speed and user experience, overcoming the technical defects of low component library construction efficiency and high client scheduling difficulty, and can effectively improve the component library construction efficiency and effectively reduce the difficulty of the client calling the component library.

[0124] Optionally, the generation module 10 is also used to obtain business requirements, extract general functions based on the business requirements, wherein the functions include at least data entry function, interaction function, feedback function, navigation function and data display function; generate the basic components based on the general functions; combine the basic components to generate composite components; obtain business logic, and generate business components based on the business logic and the composite components.

[0125] Optionally, the construction module 20 is also used to perform integration testing based on the basic components, the composite components and the business components to obtain qualified components; obtain style variables and interface variables, and associate the style variables and the interface variables with the qualified components respectively to obtain associated qualified components; and build a component library based on the associated qualified components.

[0126] Optionally, the construction module 20 is also used to perform functional testing on the basic components, the composite components and the business components respectively to obtain functional testing results; perform compatibility testing on the basic components, the composite components and the business components respectively to obtain compatibility testing results, wherein the compatibility testing includes at least operating system compatibility, device compatibility and application version compatibility; and determine qualified components based on the functional testing results and the compatibility testing results.

[0127] Optionally, the construction module 20 is also used to determine, when the functional test results and the compatibility test results are both passed, the corresponding basic components, composite components and business components as the basic components that passed the test, the composite components that passed the test and the business components that passed the test; and obtain qualified components based on the basic components that passed the test, the composite components that passed the test and the business components that passed the test.

[0128] Optionally, the calling module 40 is also used to match the component library according to the component to be used to obtain the corresponding component in the component library; obtain the interface variable of the corresponding component; call the corresponding component according to the interface variable, and send the corresponding component to the request page of the client application.

[0129] Optionally, the calling module 40 is also used to obtain the properties of the component to be used; match the properties of the component to be used with the properties of each component in the component library to obtain the property matching degree between the component to be used and each component in the component library; determine the matching component according to the property matching degree; when there are multiple matching components, determine the target component among the multiple matching components according to a preset priority rule; and use the target component as the corresponding component in the component library.

[0130] The component library construction and calling device provided by the present application adopts the component library construction and calling method in the above embodiment, which can solve the technical problem of how to effectively improve the efficiency of component library construction and effectively reduce the difficulty of client calling component library. Compared with the prior art, the beneficial effects of the component library construction and calling device provided by the present application are the same as the beneficial effects of the component library construction and calling method provided by the above embodiment, and other technical features in the component library construction and calling device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0131] The present application provides a component library construction and calling device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the component library construction and calling method in the above-mentioned embodiment 1.

[0132] Reference below Figure 7, which shows a schematic diagram of a component library construction and invocation device suitable for implementing the embodiment of the present application. The component library construction and invocation device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The component library construction and calling device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0133] like Figure 7 As shown, the component library construction and calling device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the component library construction and calling device are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the component library construction and calling device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a component library construction and calling device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.

[0134] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0135] The component library construction and calling device provided by the present application adopts the component library construction and calling method in the above embodiment, which can solve the technical problem of how to effectively improve the efficiency of component library construction and effectively reduce the difficulty of client calling component library. Compared with the prior art, the beneficial effects of the component library construction and calling device provided by the present application are the same as the beneficial effects of the component library construction and calling method provided by the above embodiment, and other technical features in the component library construction and calling device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0136] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0137] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0138] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the component library construction and calling method in the above-mentioned embodiment.

[0139] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0140] The computer-readable storage medium may be included in the component library construction and calling device; or may exist independently without being assembled into the component library construction and calling device.

[0141] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the component library construction and calling device, the component library construction and calling device: obtains basic components, and generates composite components and business components based on the basic components; builds a component library based on the basic components, the composite components and the business components; responds to a function request of a client application, and determines a component to be used based on the function request; calls a corresponding component in the component library according to the component to be used, and sends the corresponding component in the component library to the request page of the client application.

[0142] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0143] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0144] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0145] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned component library construction and calling method, and can solve the technical problem of how to effectively improve the efficiency of component library construction and effectively reduce the difficulty of client calling component library. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the component library construction and calling method provided by the above-mentioned embodiment, and will not be repeated here.

[0146] The present application also provides a computer program product, including a computer program, which implements the steps of the component library construction and calling method as described above when executed by a processor.

[0147] The computer program product provided by the present application can solve the technical problem of how to effectively improve the efficiency of component library construction and effectively reduce the difficulty of client calling component library. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the component library construction and calling method provided by the above embodiment, which will not be repeated here.

[0148] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A component library construction and calling method, characterized in that: The method comprises: Obtain basic components, and generate composite components and business components based on the basic components; Building a component library according to the basic component, the composite component and the business component; In response to a function request of a client application, determining a component to be used based on the function request; The corresponding component in the component library is called according to the component to be used, and the corresponding component in the component library is sent to the request page of the client application.

2. The method according to claim 1, characterized in that The obtaining of basic components and generating composite components and business components according to the basic components includes: Obtaining business requirements, and extracting common functions according to the business requirements, wherein the common functions at least include data entry function, interaction function, feedback function, navigation function and data display function; Generate basic components according to the general functions; Combining the basic components to generate a composite component; The business logic is obtained, and a business component is generated according to the business logic and the composite component.

3. The method according to claim 1, characterized in that The constructing of a component library according to the basic component, the composite component and the business component includes: Performing integration testing on the basic components, the composite components, and the business components to obtain qualified components; Acquire a style variable and an interface variable, and associate the style variable and the interface variable with the qualified component respectively to obtain the associated qualified component; A component library is constructed according to the associated qualified components.

4. The method according to claim 3, characterized in that The step of performing integration testing on the basic component, the composite component and the business component to obtain a qualified component includes: Performing functional tests on the basic component, the composite component, and the business component respectively to obtain functional test results; Performing compatibility tests on the basic component, the composite component and the business component respectively to obtain compatibility test results, wherein the compatibility test at least includes operating system compatibility, device compatibility and application version compatibility; Qualified components are determined according to the functional test results and the compatibility test results.

5. The method according to claim 4, characterized in that The determining of qualified components according to the functional test results and the compatibility test results includes: When both the functional test result and the compatibility test result are tested passed, determining the corresponding basic components, composite components and business components as the basic components that passed the test, the composite components that passed the test and the business components that passed the test; Qualified components are obtained according to the basic components that have passed the test, the composite components that have passed the test, and the business components that have passed the test.

6. The method according to claim 1, characterized in that The calling a corresponding component in the component library according to the component to be used, and sending the corresponding component in the component library to the request page of the client application, includes: Perform component matching on the component library according to the component to be used to obtain the corresponding component in the component library; Obtaining the interface variable of the corresponding component; The corresponding component is called according to the interface variable, and the corresponding component is sent to the request page of the client application.

7. The method according to claim 6, characterized in that The performing component matching on the component library according to the component to be used to obtain the corresponding component in the component library includes: Obtaining the properties of the component to be used; According to the matching of the attribute of the component to be used with the attribute of each component in the component library, the attribute matching degree between the component to be used and each component in the component library is obtained; Determining matching components according to the attribute matching degree; When there are multiple matching components, determining a target component among the multiple matching components according to a preset priority rule; The target component is used as a corresponding component in a component library.

8. A component library construction and calling device, characterized in that: The component library construction and calling device comprises: A generation module, used to obtain basic components and generate composite components and business components based on the basic components; A construction module, used to construct a component library according to the basic component, the composite component and the business component; A determination module, configured to respond to a function request of a client application and determine a component to be used based on the function request; The calling module is used to call the corresponding component in the component library according to the component to be used, and send the corresponding component in the component library to the request page of the client application.

9. A component library construction and calling device, characterized in that: The component library construction and calling device includes: a memory, a processor, and a component library construction and calling program stored in the memory and executable on the processor, wherein the component library construction and calling program is configured to implement the component library construction and calling method as described in any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores a component library construction and calling program, which, when executed by a processor, implements the component library construction and calling method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Data shuttling method and device, computer equipment and storage medium

    CN119148901A