A unified development method, device and electronic equipment for cross-platform applets

By using code layering and dynamic function association technology, the large workload and compatibility issues of cross-platform development of mini-programs have been solved, achieving precise positioning and unified management, improving development efficiency and quality, and reducing maintenance costs.

CN116225377BActive Publication Date: 2025-12-05WIN FIREBUG INFORMATION TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211576451.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-08
Publication Date
2025-12-05
Estimated Expiration
2042-12-08

AI Technical Summary

Technical Problem

In existing technologies, cross-platform development of mini-programs involves a large workload, is difficult to maintain, and suffers from compatibility issues during iterative development and bug fixing. It also lacks precise positioning methods and cannot quantify development and testing workload, leading to resource waste and quality risks.

Method used

By employing code layering and dynamic function association technology, probe code is added to the test environment to dynamically collect business operation trajectory data, establish the association between business functions and probe code, automatically analyze the scope of impact during iterative development and bug fixing, perform regression testing and compatibility testing, and use conditional compilation to generate platform-specific deployment packages.

Benefits of technology

It enables unified development of cross-platform mini-programs, accurately determines the scope of compatibility, saves development and testing resources, ensures the quality of online deployment, facilitates cross-platform expansion, and reduces marginal costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116225377B_ABST
    Figure CN116225377B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of program development, and particularly relates to a unified development method, device and electronic equipment for cross-platform applets, which adopts a unique code layering and function and code dynamic association as a core, combines code probes, conditional compilation and other technologies, realizes unified development of applets on various platforms, unifies and concentrates project management, is more efficient and intensive, and accurately locates the function modules affected each time iteration development or bug repair is performed, contains direct influence and indirect influence due to the call chain of other code calling the modified code, completely solves the compatibility problem of cross-platform, automatically identifies the affected range each time code is modified, not only accurately determines the cross-platform compatibility range, but also accurately locates other functions affected due to the modification of one function caused by the call association relationship, saves development and test resources, ensures the online quality of applet applications, and facilitates cross-platform expansion.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of program development, and particularly relates to a cross-platform applet unified development method and device and electronic equipment. BACKGROUND

[0002] As a lightweight mobile application, the applet has become a universal carrier of mobile applications and is widely used because of its simple use, no need for separate installation, and the ability to rely on the powerful resources of the host platform to obtain traffic. However, it also brings a series of problems. Because the applet is hosted on various platforms, and each platform is engaged in different fields, has different levels of maturity, and provides different platform applet development languages for the consideration of maintaining its own interests. Although the development languages are unified as Javascript, the specific features, components, and even the same function logic apis (Application Programming Interface) are different. The use process is large, and the function name is small. In order to solve these cross-platform compatibility problems, many development teams develop a set of applet code for each host platform. However, the current market has major mainstream applet host platforms such as WeChat, Alipay, DingTalk, Baidu, Feishu, and Fast Application. Each platform has its own large user group, which is the potential customer that applet operators desire. This results in a development workload that is multiplied by several times. Moreover, this does not include a series of other platforms with relatively small influence. In addition, multiple sets of code for an application also cause maintenance difficulties, and the workload for iterative development and bug repair is also multiplied. This not only leads to a large amount of manpower and financial investment, but also seriously contradicts the goal of agile iteration.

[0003] Currently, some companies on the market have tried to solve the aforementioned problems. For example, some development frameworks implement cross-WeChat and DingTalk platforms, and other platforms still require separate code development. Moreover, the most important thing is that during the later iterative development and bug repair, it is impossible to accurately know which related functions and platforms will be affected by the modification of the code. These problems have not been fundamentally solved. Specifically, the following problems exist in this field:

[0004] 1. The operating environment of each platform's mini-program is managed and maintained by the companies that own the platform. Although they are all based on the Javascript interpreter kernel, the more features are added and modified on top of each other, the more diverse they become. This is especially true in areas such as authentication, authorization, and interaction between the mini-program and external systems. The mechanisms and processes of each platform are very different and require different code implementations. As mentioned earlier, developing multiple sets of code is a huge workload and the subsequent maintenance workload increases exponentially. Simply putting multiple sets of code for multiple platforms into a single development environment project is equivalent to piling up code, and the problems still exist.

[0005] 2. Even if the first version of a mini-program application is developed through extensive manual trials, verifications, modifications, and iterations to achieve cross-platform compatibility with a single codebase, subsequent iterations and bug fixes require repeating this time-consuming and laborious manual trial-and-error process whenever code is modified. Otherwise, mini-programs on platforms without manual verification may have compatibility issues that will surface after launch. Fixing these issues may, in turn, affect previously verified mini-programs, creating a vicious cycle of neglecting one aspect for another. Furthermore, the lack of a methodology and scientific process for accurately and automatically identifying compatibility and even business functionality issues during each modification throughout the lifecycle of a cross-platform mini-program application demonstrates a lack of understanding of cross-platform compatibility.

[0006] 3. During each iteration of mini-program development, it is impossible to quantify the workload of developers and testers. Two functions that are similar in business may have vastly different workloads. The former only needs to be modified once without cross-platform compatibility issues, while the latter requires multiple modifications due to cross-platform compatibility problems. The same applies to testing work. All of these require a precise quantification method. Summary of the Invention

[0007] This invention provides a unified development method, apparatus, and electronic device for cross-platform mini-programs, which accurately determines the scope of cross-platform compatibility, saves development and testing resources, ensures the quality of mini-program applications upon launch, and facilitates cross-platform expansion.

[0008] This specification provides an embodiment of a unified development method for cross-platform mini-programs, including:

[0009] Construct a mini-program framework, which includes a business layer, a call layer, and a program deployment layer;

[0010] In the test environment, probe code is added to all running modules in the business layer, the calling layer, and the program deployment layer to dynamically collect business operation trajectory data sent by the probe code.

[0011] establishing a dynamic association relationship between the business function and the probe code in the business layer based on the business running track data;

[0012] automatically analyzing the business impact range and / or the compatibility impact range according to the dynamic association relationship between the business function and the probe code when iteratively developing and / or repairing the program of the applet;

[0013] performing regression testing on the business function in the business impact range and / or performing compatibility testing on the platform corresponding to the compatibility impact range, and updating the applet based on the testing result.

[0014] Preferably, the probe code is added to all running modules existing in the business layer, the calling layer and the program deployment layer in the test environment, including:

[0015] Based on conditional compilation, the probe code is inserted before and after the execution of the function and / or statement in the test environment in combination with the parameters transmitted by the operator during configuration.

[0016] Preferably, the business running track data sent by the probe code is dynamically collected, including:

[0017] The probe code is executed, and the business running track data generated during the execution of the business by the probe code is transmitted, wherein the business running track data at least contains the class name, the function name and the line number.

[0018] Preferably, the business impact range and / or the compatibility impact range are automatically analyzed according to the dynamic association relationship between the business function and the probe code, including:

[0019] constructing a jungle of the applet;

[0020] determining the range of the jungle based on the dynamic association relationship between the business function and the probe code;

[0021] when new code and / or new business function is introduced within the range of the jungle, determining the business impact range and / or the compatibility impact range within the range of the jungle;

[0022] when new code and / or new business function is introduced beyond the range of the jungle, determining the dependency relationship and the influencing factor between the new code and the original code, expanding the range of the jungle based on the dependency relationship and the influencing factor, and determining the business impact range and / or the compatibility impact range within the expanded range of the jungle.

[0023] Preferably, the jungle of the applet is constructed, including:

[0024] Taking the business page as a tree root, a function tree is constructed according to a script code referenced by the business page and business running track data;

[0025] When the business page is a single page, a function tree is constructed with a function area on the single page as a root;

[0026] A jungle of the applet is constructed based on the function tree.

[0027] Preferably, the dependency relationship between the new code and the original code is determined, including:

[0028] The new code and / or the added new business function are subjected to lexical analysis and syntax analysis to construct an abstract syntax tree and form a data structure in JSON format;

[0029] The calling level of the data structure on the original code is analyzed, and the dependency relationship between the new code and the original code is proportional to the height of the calling level.

[0030] Preferably, the applet is updated based on the test result, including:

[0031] When the test result shows that the test is normal, code packaging is performed by using a compilation route with conditional compilation as a core, and an applet deployment package for a corresponding platform is generated.

[0032] The embodiments of the present specification further provide a unified development device of a cross-platform applet, including:

[0033] A framework construction module is configured to construct an applet framework, the applet framework including a business layer, a calling layer and a program deployment layer;

[0034] A probe adding module is configured to add probe code to all running modules existing in the business layer, the calling layer and the program deployment layer in a test environment, and dynamically collect business running track data sent by the probe code;

[0035] An association module is configured to establish a dynamic association relationship between business functions in the business layer and the probe code based on the business running track data;

[0036] A range analysis module is configured to automatically analyze a business range of influence and / or a compatibility range of influence according to the dynamic association relationship between the business functions and the probe code when iterative development and / or program vulnerability repair are performed on the applet;

[0037] A test module is configured to perform regression testing on business functions in the business range of influence and / or compatibility testing on platforms corresponding to the compatibility range of influence, and update the applet based on a test result.

[0038] An electronic device, wherein the electronic device comprises:

[0039] A processor and a memory storing computer-executable instructions that, when executed, cause the processor to perform any of the above methods.

[0040] A computer-readable storage medium, wherein the computer-readable storage medium stores one or more instructions that, when executed by a processor, implement any of the above methods.

[0041] The application adopts a unique code layering, function and code dynamic association as the core, combined with code probe, conditional compilation and other technologies, realizes the unified development of small programs on various platforms, unifies and concentrates project management, so as to be more efficient and intensive, and accurately locates the affected function modules each time the iteration development or bug repair is carried out, including direct influence and indirect influence due to the call chain of other code calling, completely solves the compatibility problem of cross-platform, realizes automatic identification of the affected range each time the code is modified, not only accurately determines the cross-platform compatibility range, but also accurately locates the other functions affected by the modification of one function due to the call association relationship, saves the development and test resources, and also ensures the online quality of the small program application, facilitates the cross-platform expansion of the small program, and the marginal cost is extremely low. BRIEF DESCRIPTION OF DRAWINGS

[0042] The drawings described herein are used to provide further understanding of the present application, and form a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation on the present application. In the drawings:

[0043] Figure 1 A principle schematic diagram of a unified development method of a cross-platform small program provided by an embodiment of the present application;

[0044] Figure 2 A unified development layer structure diagram of a cross-platform small program provided by an embodiment of the present application;

[0045] Figure 3 An association relationship diagram between business functions and codes provided by an embodiment of the present application;

[0046] Figure 4 A structure schematic diagram of a unified development device of a cross-platform small program provided by an embodiment of the present application;

[0047] Figure 5 A structure schematic diagram of an electronic device provided by an embodiment of the present application;

[0048] Figure 6A schematic diagram of a computer readable medium according to an embodiment of the present specification. DETAILED DESCRIPTION

[0049] Exemplary embodiments of the present application will now be described more fully with reference to the accompanying drawings. The exemplary embodiments, however, can be embodied in various forms, and should not be construed as being limited to only the embodiments set forth herein. Rather, the exemplary embodiments are provided as a full and enabling disclosure of the application, and are presented to provide an enabling concept of the application to those skilled in the art. Like reference numerals refer to like elements throughout the several views of the drawings, and thus repeated description is omitted.

[0050] Features, structures, characteristics or other details described in relation to a certain embodiment are not excluded from being implemented in one or more other embodiments as long as the technical concept of the present application is not violated.

[0051] In the description of the specific embodiments, features, structures, characteristics or other details described in relation to the present application are to make those skilled in the art have a full understanding of the embodiments. However, it is not excluded that one or more of the specific features, structures, characteristics or other details can not be practiced by those skilled in the art without the technical solution of the present application.

[0052] The diagrams shown in the drawings are only exemplary illustrations, and do not necessarily include all the contents and operations / steps, nor are they necessarily executed in the order described. For example, some operations / steps can be further decomposed, and some operations / steps can be combined or partially combined, so the actual execution order can be changed according to the actual situation.

[0053] The block diagrams shown in the drawings are only functional entities, and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0054] The term "and / or" or "and / or" includes all combinations of any one or more of the associated listed items.

[0055] Reference Figure 1 A schematic diagram of a cross-platform applet unified development method according to an embodiment of the present specification, comprising:

[0056] S101: Construct an applet framework, the applet framework comprising a business layer, a calling layer, and a program deployment layer;

[0057] In a preferred embodiment of the present application, first, the applet is applied to the black and white layering in the architectural design phase, and the guiding ideology is from top to bottom three kinds of business layer 1, calling layer 2, program deployment layer 3, business layer 1 is recorded as white module, white module is business code or general code independent of specific host platform, program deployment layer 3 is recorded as black module, black module is code related to host platform, calling layer 2 is set between business layer 1 and program deployment layer 3 to connect, calling layer 2 is recorded as gray module, as shown in Figure 2 As shown, this is technically a layered software architecture style, combined with the business characteristics of the applet application. Generally speaking, the continuous iterative development of the applet application is mainly for the addition, modification, deletion and other functions of the business, and the corresponding is the addition, modification, deletion of the upper white module, which is changed frequently. The addition, modification, deletion of the black module is changed with the version upgrade of the host platform, and there is no need to change without upgrade, and the change is less. The gray module in the middle is added, modified when the upper white module needs to call the new black module or its characteristics. In this way, the white module does not need to consider the cross-platform compatibility problem, it can only call other white modules and gray modules, and cannot directly call platform-related black modules. Specifically, the black module is unknown to the white module, and the functions provided by the black module are all encapsulated in the gray module, and the specific function of the black module is one for each platform.

[0058] The applet application in the market in the past is separated across several host platforms. Except that the demand is the same, the subsequent development, testing and delivery are separated, like each ray diverging from the demand origin, and there is almost no cross on each ray, so the total workload is still large. Through code black and white layering and dynamic association of functions and code, the present application clearly identifies the same and different parts across platforms, and automatically identifies whether there is a cross-platform compatibility problem and the number of platforms involved in compatibility, so that project management does not need to be subdivided by platform, and compatibility problems are integrated into the general development problem set as general problems, so that project management is unified and concentrated, thereby being more efficient and intensive.

[0059] S102: adding probe code to all running modules existing in the business layer, the calling layer and the program deployment layer in the test environment, and dynamically collecting business running track data sent by the probe code;

[0060] Further, the adding of the probe code to all running modules existing in the business layer, the calling layer and the program deployment layer in the test environment includes:

[0061] Based on conditional compilation, the probe code is inserted before and after the function and / or statement execution in the test environment combined with the parameters transmitted by the operator configuration.

[0062] Further, the probe code transmits the business running track data, including:

[0063] The probe code is executed, and the business running track data generated when the business is executed by the probe code is transmitted, and the business running track data at least contains the class name, function name and line number.

[0064] In the preferred embodiment of the application, the probe code is added to all modules (white module, gray module and black module) of the applet, and the purpose is to dynamically obtain the business running track data and the corresponding relationship with the business function module in the test environment. Two technologies are used to deal with modules at different levels: AOP (Aspect Oriented Programming, Aspect Oriented Programming) function level and statement level. The latter is more accurate but more complex than the former. For gray modules, the latter needs to be used because the same function may call different platform codes and must be accurate to the statement level. White module and black module are generally to the function level. By using probe processing tools, conditional compilation and other technologies, the probe code is inserted before and after the function and / or statement call or execution in the source code in the test environment according to the parameters transmitted by the operator configuration. The function level uses the AOP support syntax of Javascript to realize quickly, and the probe code realizes the transmission of business running track data to the self-developed platform and saves to the database when the code is executed. The data structure of the business running track data contains the class name, function name and line number and other key position information, so as to accurately record the runtime call relationship of the class and function. Because the probe code will increase the packaging and deployment package, and there will be a certain performance loss during runtime, it is only used in the test environment, and the production environment realizes no-probe packaging and deployment through conditional compilation.

[0065] S103: Based on the business running track data, the dynamic association relationship between the business function in the business layer and the probe code is established.

[0066] In the preferred embodiment of the application, with the probe code, all business functions of the applet are established in the applet application business function management platform. Each business function is run in the test environment during initialization, and the business running track data transmitted by the probe code is dynamically collected, so as to realize the association of the two, Figure 3This diagram illustrates the function-level relationships. In it, business function 01 is associated with the code call chain of function b → function d → function e → function f, while business function 2 is associated with the code call chain of function c → [function f, function h → function g]. They also share function f, providing support for automatically determining the scope of business impact based on subsequent code modifications. Through the layered structure of the mini-program framework and the dynamic association between business functions and business operation trajectory data, each platform, from requirements to development, testing, delivery, and even the next iteration cycle, forms a horizontally interconnected whole. The similarities and differences across platforms are clearly identified, and cross-platform compatibility issues and the number of platforms involved are automatically identified. Project management no longer needs to be subdivided by platform; compatibility issues are integrated into the general development issue set, making project management unified and centralized, thus more efficient and streamlined.

[0067] S104: When iteratively developing and / or fixing program vulnerabilities in the mini-program, the scope of business impact and / or the scope of compatibility impact are automatically analyzed based on the dynamic correlation between business functions and the probe code.

[0068] In a preferred embodiment of the present invention, when iteratively developing the mini-program and / or fixing program vulnerabilities, such as: modifying... Figure 3 By examining the code of function d, we can determine that business function 01 is affected. If function f is modified, the impact will extend to both business functions 01 and 02. This method automatically analyzes the scope of business impact and / or compatibility impact based on the dynamic relationship between business functions and probe code, accurately determining cross-platform compatibility. It also precisely identifies how modifying one function due to its call relationships affects other functions. This significantly saves development and testing resources and ensures the quality of the launched mini-program application.

[0069] S105: Perform regression testing on the business functions within the scope of the business impact and / or perform compatibility testing on the platform corresponding to the scope of the compatibility impact, and update the mini-program based on the test results.

[0070] In a preferred embodiment of the present invention, for example: modifications were made. Figure 3If the code for function d is modified, it will be known that business function 01 is affected and requires regression testing, while other business functions are unaffected and require no handling. If function f is modified, the impact will be on both business functions 01 and 02, both of which require regression testing. Furthermore, in situations with detailed development divisions, if the code calling functions d or f is modified by other developers, even if they haven't modified their own code, they are still considered affected at the code level due to the call relationship and need unit testing to prevent errors in their own code due to incorrect calls. Additionally, the scope of cross-platform compatibility impact can be determined based on whether the modified and affected code belongs to gray or black modules. If it's a black module, its corresponding host platform needs to be tested for compatibility; if it's a gray module, all platforms involved in the gray module need to be tested for compatibility. Therefore, gray modules are generally added as statement-level probes in the test environment to more accurately locate the scope of impact. Also, gray modules are usually small, connecting lines of code to minimize the impact of each modification on the gray module. By using the above method to automatically identify the scope of impact of each code modification, we can not only accurately determine the scope of cross-platform compatibility, but also accurately determine other business functions affected by a modification of one function due to the call relationship. This greatly saves development and testing resources and ensures the quality of the mini-program application when it goes live.

[0071] Furthermore, updating the mini-program based on the test results includes:

[0072] When the test results show that the test is normal, the code is packaged using a compilation route based on conditional compilation to generate a mini-program deployment package for the corresponding platform.

[0073] In a preferred embodiment of the present invention, the gray module is used to connect the white module and the black module. Generally, the gray module corresponds to the black module of N platforms in a 1:N ratio. They are connected by compilation routing technology to generate the corresponding platform's mini-program deployment package and publish it to the corresponding platform. Compilation routing is based on conditional compilation and expands on some parameter passing. Below is a conditional compilation example:

[0074] #ifdef MP-WEXIN

[0075] WeChat platform-specific code

[0076] #elseifdef ALIPAY

[0077] Alipay platform dedicated code

[0078] #elseifdef DINGDING

[0079] DingTalk platform dedicated code

[0080] #elseifdef BAIDU

[0081] DingDing platform special code

[0082] #elseifdef FEISHU

[0083] Feishu platform special code

[0084] #else

[0085] Error or warning (no matching platform)

[0086] #endif

[0087] When the code is packaged, the corresponding code is retained based on the condition compilation value passed in, and other platform codes are excluded, in order to be able to explicitly view the routing result in the generated result code without polluting the code, the condition compilation syntax is converted into a comment in the front-end development language during conversion, in Javascript, the comment is used " / / comment", in css, the comment is used " / * comment * / ", and for some mature development frameworks, such as VUE.JS, the comment "<!-- comment -->" is used.

[0088] The application not only solves the cross-platform development of the initial version of the applet application, but more importantly, covers the entire life cycle of the subsequent iteration of the applet, and the more iterations and the longer the time, the greater the cumulative benefits. Generally speaking, as a kind of application software, the first version of the applet application is put online, and with the feedback of the market and use and the development of technology, it will be iterated, many large applications in the field of Internet have an iteration period of 0.5-1 month, bug repair is frequently modified, and there is high-density iteration development, and the application realizes automatic identification of the scope of each code modification, not only accurately determines the cross-platform compatibility range, but also accurately locates the other functions affected by modifying a function due to the call association relationship, greatly saving the development and test resources, and ensuring the online quality of the applet application.

[0089] In the preferred embodiment of the application, the white module with the largest amount of code in the applet application can be reused, only the gray module (also mainly adding the judgment branch of the corresponding new platform) is modified, and the black module of the new platform is added, the workload is very small; then running on the new platform once to initialize the data, collecting the association relationship between the functions and the code of the new platform, and dynamically optimizing the code structure according to the business running track data, such as detecting that the program development is not standardized and directly crossing the gray module to call the black module. In this way, the new platform is integrated, and the subsequent process remains unchanged. This expansion is extremely flexible, the marginal cost is extremely low, and it greatly facilitates the applet application to expand more cross-platform.

[0090] Further, the business function and the dynamic association relationship between the probe code are automatically analyzed to obtain the business coverage and / or the compatibility coverage, comprising:

[0091] Constructing the jungle of the small programs;

[0092] Determining the range of the jungle based on the dynamic association relationship between the business function and the probe code;

[0093] When the new code and / or the new business function is introduced within the range of the jungle, the business coverage and / or the compatibility coverage within the range of the jungle is determined;

[0094] When the new code and / or the new business function is introduced beyond the range of the jungle, the dependency relationship between the new code and the original code and the influencing factors are determined, the range of the jungle is expanded based on the dependency relationship and the influencing factors, and the business coverage and / or the compatibility coverage within the expanded range of the jungle is determined.

[0095] Further, the dependency relationship between the new code and the original code is determined, comprising:

[0096] The new code and / or the new business function is subjected to lexical analysis and syntax analysis to construct an abstract syntax tree and form a data structure in JSON format;

[0097] The calling level of the data structure to the original code is analyzed, and the dependency relationship between the new code and the original code is proportional to the calling level.

[0098] In the preferred embodiment of the present application, the jungle algorithm determines the scope of the jungle based on the dynamic association between the first established business function and the probe code, and subsequent modifications within the scope are judged as modifications of the function tree in the jungle, without considering that new function trees are added due to the increase of part of the code; code outside the baseline scope is considered as the expansion of the jungle, and the judgment of the code outside the baseline scope considers factors such as the calling or dependency relationship between the new code and the original code, the date of the addition of the new code, etc. Since the new code has not been run, the AST (Abstract Syntax Tree) technology is used to analyze the new code, build an abstract syntax tree, form a JSON format data structure, and analyze the calling and calling level of the original code based on this, where the higher the calling level, the greater the dependency between the new code and the original code, and the lower the dependency. Because the lower level code is farther away from the specific business logic and closer to the API (Application Programming Interface) interface provided by the platform. Consider from two aspects: one is which kind of white module, gray module, black module the calling original code belongs to, and the gray module and the black module are far away from the specific business logic; the other is for the white module calling the original code, combined with the calling in-degree of the called white module in the original code, the greater the in-degree, the stronger the generality, and the farther away from the specific business logic, such as network communication module. Through the above jungle algorithm, new business functions are identified, or new open source code is introduced by technical personnel, and then the business impact range and / or compatibility impact range within the jungle range are identified to remind the developer to initialize the association accordingly.

[0099] Further, the jungle of the applet is constructed, comprising:

[0100] Taking the business page as the tree root, a function tree is constructed according to the script code and business running track data referenced by the business page;

[0101] When the business page is a single page, a function tree is constructed with the function area on the single page as the root;

[0102] Based on the function tree, the jungle of the applet is constructed.

[0103] In the preferred embodiment of the present application, when the applet application is iteratively developed, new business functions are often added, or new open source code is introduced by technical personnel, etc., which will add new isolated code in the original code library, without association with the newly added or existing business functions. At this time, the jungle algorithm is used to determine whether it is newly added code, and the developer is prompted to perform the corresponding initialization association through the corresponding software platform. The jungle algorithm takes the page as the tree root, and constructs a function tree according to the referenced Javascript code of the page and the obtained business running track data. Many such function trees constitute the jungle of the entire applet application. For SPA (single-page application), the function area on the single page is taken as the root to construct the corresponding tree. This is very common for the separation development of different areas of the SPA main page in the framework front-end development. At the same time, manual intervention can be made in the construction of the function tree in the jungle, such as artificially dividing a page into two trees for easier management. This is operated when dividing the business functions of the applet application before establishing the dynamic relationship between the business functions and the probe code. Through the above-mentioned manner, the determination of the jungle in the jungle algorithm is realized, which is convenient for identifying new business functions or introducing new open source code by technical personnel, and provides a theoretical basis for subsequent identification of the business impact range and / or compatibility impact range within the jungle range.

[0104] Figure 4 A structure schematic diagram of a cross-platform applet unified development device provided by an embodiment of the present application, comprising:

[0105] The framework building module 201 is configured to build an applet framework, wherein the applet framework comprises a business layer, a calling layer and a program deployment layer.

[0106] The probe adding module 202 is configured to add probe code to all running modules existing in the business layer, the calling layer and the program deployment layer in a test environment, and dynamically collect business running track data sent by the probe code.

[0107] The association module 203 is configured to establish a dynamic association relationship between the business functions in the business layer and the probe code based on the business running track data.

[0108] The impact range analysis module 204 is configured to automatically analyze a business impact range and / or a compatibility impact range according to the dynamic association relationship between the business functions and the probe code when iteratively developing and / or repairing program vulnerabilities of the applet.

[0109] The test module 205 is configured to perform regression testing on the business functions in the business impact range and / or compatibility testing on the platforms corresponding to the compatibility impact range, and update the applet based on the test results.

[0110] The functions of the apparatus according to the embodiments of the present application have been described in the above-mentioned method embodiments, and thus the description of the present embodiments will not be repeated here.

[0111] Based on the same inventive concept, the present specification also provides an electronic device.

[0112] The electronic device embodiments of the present application are described below, which can be regarded as specific physical implementations of the above-mentioned method and apparatus embodiments of the present application. The details described in the electronic device embodiments of the present application should be regarded as a supplement to the above-mentioned method or apparatus embodiments; for the details not disclosed in the electronic device embodiments of the present application, reference can be made to the above-mentioned method or apparatus embodiments.

[0113] Reference Figure 5 A structural schematic diagram of an electronic device according to an embodiment of the present specification is provided. The electronic device 300 according to the embodiment of the present application is described below with reference to Figure 5 Figure 5 The electronic device 300 shown is merely an example and should not impose any limitation on the functions and use range of the embodiments of the present application.

[0114] As Figure 5 shown, the electronic device 300 is in the form of a general computing device. The components of the electronic device 300 can include, but are not limited to, at least one processing unit 310, at least one storage unit 320, a bus 330 connecting different device components (including the storage unit 320 and the processing unit 310), a display unit 340, etc.

[0115] The storage unit stores program codes which can be executed by the processing unit 310, so that the processing unit 310 performs the steps according to various exemplary embodiments of the present application described in the above processing method part of the present specification. For example, the processing unit 310 can perform the steps as shown in Figure 1 .

[0116] The storage unit 320 can include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 3201 and / or a cache memory 3202, and can further include a read-only memory (ROM) 3203.

[0117] The storage unit 320 can also include program / utilities 3204 with a set of (at least one) program modules 3205, such as operation devices, one or more application programs, other program modules, and program data, each of which or some combination of which can include the implementation of a network environment.​

[0118] Bus 330 can be one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, a graphics bus, a processor or local bus using any of a variety of bus architectures.

[0119] Electronic device 300 can also communicate with one or more external devices 400 such as a keyboard or pointing device, a Bluetooth device, etc.; other devices that enable a user to interact with electronic device 300; and / or any devices (e.g., a router, a modem, a printer, etc.) that enable electronic device 300 to communicate with one or more other computing devices. Such communication can occur via Input / Output (I / O) interface 350. Still yet, electronic device 300 can communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), and / or a public network (e.g., the Internet) via network adapter 360. As depicted, network adapter 360 can communicate with the other components of electronic device 300 via bus 330 although it is understood that many other architectures can be implemented to enable communication between electronic device 300 and another computing device or network. Figure 5 Other hardware and / or software modules that can be used in conjunction with electronic device 300 can also be employed in electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID devices, tape drives, and data archival storage devices, etc.

[0120] Those skilled in the art will readily understand that the exemplary embodiments described in the specification can be implemented by software, or by software in combination with the necessary hardware, and that the technical solutions according to the embodiments of the present application can be embodied in the form of a software product. The software product can be stored in a computer readable storage medium (which can be a CD-ROM, an U disk, a mobile hard disk, etc.) or a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to perform the above-described methods according to the present application. When the computer program is executed by a data processing device, the computer readable medium enables the data processing device to implement the above-described methods of the present application, i.e., the method shown in Figure 1 .

[0121] Referring to Figure 6 a schematic diagram of a computer readable medium according to an embodiment of the present specification.

[0122] Implementation Figure 1A computer program in the method can be stored on one or more computer readable media. The computer readable media can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable disc, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0123] The computer readable storage medium can include a data signal transported, for example, over a baseband or a carrier wave by a contract bridge, where the contract bridge carries the readable program code. The data signals can be in various forms, including but not limited to electro-magnetic, optical, or any suitable combination of the foregoing. The computer readable storage medium can also be any computer readable medium other than a transitory, propagating signal per se. The program code included on the computer readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, and the like, or any suitable combination of the foregoing.

[0124] The program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, and the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider (ISP).

[0125] In light of the above, the present application can be implemented in hardware, or implemented in software modules running on one or more processors, or implemented in a combination of the two. Those skilled in the art should understand that some or all of the functions of some or all of the components according to the embodiments of the present application can be implemented in practice using a general-purpose data processing device such as a microprocessor or a digital signal processor (DSP). The present application can also be implemented as a device or apparatus program (for example, a computer program and a computer program product) for performing part or all of the methods described herein. Such a program implementing the present application can be stored on a computer readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0126] The above-described specific embodiments further illustrate the purposes, technical solutions and beneficial effects of the present application, and it should be understood that the present application is not inherently related to any specific computer, virtual device or electronic device, and various general-purpose devices can also implement the present application. The above-described is only a specific embodiment of the present application, and is not used to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

[0127] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment mainly describes the difference from other embodiments.

[0128] The above-described is only an embodiment of the present application, and is not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the claims of the present application.

Claims

1. A method for uniform development of cross-platform applets, characterized in that, The application comprises the following steps: A mini-program framework is constructed, which comprises a business layer, a calling layer and a program deployment layer; Probe codes are added to all running modules in the business layer, the calling layer and the program deployment layer in a test environment, the probe codes are executed, and business running track data generated during business execution is sent by using the probe codes, wherein the business running track data at least contains class name, function name and line number; A dynamic association relationship between business functions in the business layer and the probe codes is established based on the business running track data; When iterative development and / or program bug repair are performed on the mini-program, a function tree is constructed for each business page as a tree root according to script codes referenced by the business page and business running track data; When a business page is a single page, a function tree is constructed for a functional area on the single page as a root; A jungle of the mini-program is constructed based on the function tree; The dynamic association relationship between business functions in the business layer and the probe codes established for the first time is taken as a baseline to determine the range of the jungle; modifications within the baseline range are modifications within the jungle range, and code modifications beyond the baseline range are modifications beyond the jungle range; When new codes and / or new business functions are introduced within the jungle range, a business impact range and / or a compatibility impact range are determined within the jungle range; When new codes and / or new business functions are introduced beyond the jungle range, a dependency relationship between the new codes and original codes and influencing factors are determined, the jungle range is expanded based on the dependency relationship and the influencing factors, and a business impact range and / or a compatibility impact range are determined within the expanded jungle range; Regression testing is performed on business functions within the business impact range and / or compatibility testing is performed on platforms corresponding to the compatibility impact range, and the mini-program is updated based on the test results.

2. The method of claim 1, wherein the method further comprises: The probe codes are added to all running modules in the business layer, the calling layer and the program deployment layer in a test environment, which comprises the following steps: Based on conditional compilation, probe codes are inserted before and after the execution of functions and / or statements in the test environment in combination with parameters transmitted by an operator during configuration.

3. The method of claim 1, wherein the method further comprises: The dependency relationship between the new codes and original codes is determined, which comprises the following steps: Lexical analysis and syntax analysis are performed on the new codes and / or new business functions to construct an abstract syntax tree and form a JSON format data structure; The calling level of the data structure on the original codes is analyzed, and the dependency relationship between the new codes and original codes is proportional to the height of the calling level.

4. The method of claim 1, wherein the method further comprises: The mini-program is updated based on the test results, which comprises the following steps: When the test results show that the test is normal, code packaging is performed by using a compilation route with conditional compilation as the core to generate a mini-program deployment package for a corresponding platform.

5. A uniform development device of cross-platform applets, characterized in that, The application comprises the following steps: A framework construction module is used to construct a mini-program framework, which comprises a business layer, a calling layer and a program deployment layer; A probe adding module is configured to add probe code to all running modules existing in the business layer, the calling layer and the program deployment layer in a test environment, execute the probe code, and send business running track data generated when the business is executed by using the probe code, wherein the business running track data at least includes class name, function name and line number. An association module is configured to establish a dynamic association relationship between the business function in the business layer and the probe code based on the business running track data. A wave range analysis module is configured to take a business page as a tree root, and construct a function tree according to script code referenced by the business page and the business running track data when the applet is iteratively developed and / or program vulnerabilities are repaired. When the business page is a single page, a function area on the single page is taken as a root to construct a function tree. A jungle of the applet is constructed based on the function tree. The dynamic association relationship between the business function in the business layer and the probe code established for the first time is taken as a baseline to determine the range of the jungle; modification within the baseline range is modification within the jungle range, and code modification beyond the baseline range is modification beyond the jungle range; when new code is introduced and / or new business function is added within the jungle range, the business wave range and / or the compatibility wave range within the jungle range are determined; when new code is introduced and / or new business function is added beyond the jungle range, the dependency relationship between the new code and the original code and influencing factors are determined, the jungle range is expanded based on the dependency relationship and the influencing factors, and the business wave range and / or the compatibility wave range within the expanded jungle range are determined. A test module is configured to perform regression testing on the business function within the business wave range and / or compatibility testing on the platform corresponding to the compatibility wave range, and update the applet based on the test result.

6. An electronic device, comprising: The electronic device includes: A processor and a memory storing computer-executable instructions that, when executed, cause the processor to perform the method of any of claims 1-4.

7. A computer readable storage medium, wherein, The computer-readable storage medium stores one or more instructions that, when executed by a processor, implement the method of any of claims 1-4.

Citation Information

Patent Citations

  • Automatic testing method and device

    CN114490424A

  • System, method and device for introducing applet into third-party APP and medium

    CN115268998A