CN112527415A - Method, device, equipment and medium for migrating applets across platforms - Google Patents
Method, device, equipment and medium for migrating applets across platforms Download PDFInfo
- Publication number
- CN112527415A CN112527415A CN202011547875.5A CN202011547875A CN112527415A CN 112527415 A CN112527415 A CN 112527415A CN 202011547875 A CN202011547875 A CN 202011547875A CN 112527415 A CN112527415 A CN 112527415A
- Authority
- CN
- China
- Prior art keywords
- platform
- file
- conversion
- applet
- rule
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44568—Immediately runnable code
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a small program cross-platform migration method, which comprises the following steps: acquiring a source program file and a default conversion rule of the applet to be migrated on the first platform; converting codes in the source program file according to a default conversion rule to obtain a standard conversion file of the applet to be migrated; acquiring a platform conversion rule of a second platform, dividing components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule, and converting the components to be converted according to the platform conversion rule to obtain a platform conversion file of the applet to be transferred; and acquiring a developer tool, and generating the target applet on the second platform according to the developer tool and the platform conversion file. According to the invention, the redevelopment of the small program codes for different second platforms is not needed, the difference of the small programs among different platforms is smoothed, and the migration efficiency of the small programs is improved. In addition, an applet cross-platform migration apparatus, device and storage medium are also provided.
Description
Technical Field
The invention relates to the technical field of computer software, in particular to a method, a device, equipment and a medium for migrating applets across platforms.
Background
The applet is an application which can be used without downloading and installing, the purpose that the application is accessible by a touch is achieved, the user can open the application by scanning or searching once, the concept of 'walking after use' is reflected, and the user does not need to care about whether too many applications are installed.
WeChat applets were generated earlier and many companies have developed WeChat applets. At present, internet huge heads such as WeChat, Baidu and Paibao have launched respective small program platforms in a dispute, and if enterprises want to be promoted on different platforms, the enterprises need to repeatedly develop small programs on different platforms. This makes the applet expensive to develop and maintain. Therefore, how to make development of applets compatible with different platforms becomes a technical problem to be solved urgently.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a device, and a medium for cross-platform migration of an applet, which enable migration of the applet between platforms.
An applet cross-platform migration method, the method comprising:
acquiring a source program file and a default conversion rule of the applet to be migrated on the first platform;
converting codes in the source program file according to the default conversion rule to obtain a standard conversion file of the applet to be migrated;
acquiring a platform conversion rule of a second platform, dividing components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule, and converting the components to be converted according to the platform conversion rule to obtain a platform conversion file of the applet to be migrated;
and acquiring a developer tool, and generating the target applet on the second platform according to the developer tool and the platform conversion file.
In one embodiment, the source program file comprises initial source code data and an initial application interface, and the default conversion rule comprises a default grammar rule and a default interface rule;
the converting the codes in the source program file according to the default conversion rule comprises:
converting the initial source code data into standard source code data of the standard conversion file according to the default grammar rule;
and converting the initial application interface into a standard application interface of the standard conversion file according to the default interface rule.
In one embodiment, the converting the initial source code data into standard source code data of the standard conversion file according to the default syntax rule includes:
parsing the initial source code data into at least one tree of nodes in a tree structure;
and traversing each node on the at least one node tree, performing replacement processing on each node according to the default grammar rule, and outputting the node tree after the replacement processing as standard source code data of the standard conversion file.
In one embodiment, the performing replacement processing on each node according to the default syntax rule includes:
and after reading the node source code data of one node, replacing the node source code data according to the default grammar rule, and replacing the file extension name of the folder to which the node source code data belongs.
In one embodiment, the dividing the components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule includes:
determining a general function in the applet to be migrated according to the platform conversion rule, taking a component for realizing the general function in the standard conversion file as the reserved component, and dividing the rest components into the components to be converted.
In one embodiment, the platform conversion rule includes a replacement rule and an upgrade rule, and the converting the component to be converted according to the platform conversion rule includes:
replacing the component to be converted according to a replacement rule; or the like, or, alternatively,
and upgrading the component to be converted according to an upgrading rule.
In one embodiment, after the generating the target applet on the second platform according to the developer tool and the platform transformation file, the method further comprises:
and acquiring a global variable contained in a source program file of the applet to be migrated, and updating the platform conversion file of the target applet according to the global variable.
An applet cross-platform migration apparatus, the apparatus comprising:
the acquisition module is used for acquiring a source program file and a default conversion rule of the applet to be migrated on the first platform;
the standard conversion module is used for converting codes in the source program file according to the default conversion rule to obtain a standard conversion file of the applet to be migrated;
the platform conversion module is used for acquiring a platform conversion rule of a second platform, dividing components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule, and converting the components to be converted according to the platform conversion rule to obtain a platform conversion file of the applet to be transferred;
and the program generation module is used for acquiring a developer tool and generating the target small program on the second platform according to the developer tool and the platform conversion file.
A computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
acquiring a source program file and a default conversion rule of the applet to be migrated on the first platform;
converting codes in the source program file according to the default conversion rule to obtain a standard conversion file of the applet to be migrated;
acquiring a platform conversion rule of a second platform, dividing components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule, and converting the components to be converted according to the platform conversion rule to obtain a platform conversion file of the applet to be migrated;
and acquiring a developer tool, and generating the target applet on the second platform according to the developer tool and the platform conversion file.
An applet cross-platform migration apparatus comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of:
acquiring a source program file and a default conversion rule of the applet to be migrated on the first platform;
converting codes in the source program file according to the default conversion rule to obtain a standard conversion file of the applet to be migrated;
acquiring a platform conversion rule of a second platform, dividing components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule, and converting the components to be converted according to the platform conversion rule to obtain a platform conversion file of the applet to be migrated;
and acquiring a developer tool, and generating the target applet on the second platform according to the developer tool and the platform conversion file.
The invention provides a method, a device, equipment and a medium for transferring an applet across platforms, which are used for converting codes in a source program file according to an acquired default conversion rule so as to obtain a standard conversion file of the applet to be transferred, so that the default content of the applet to be transferred can meet a second platform. And further converting the standard conversion file according to the platform conversion rule of the second platform so as to fill the specific proprietary function of the second platform. And finally, completing the generation and the release of the target small program through a developer tool. According to the invention, the redevelopment of the small program codes for different second platforms is not needed, the difference of the small programs among different platforms is smoothed, and the migration efficiency of the small programs is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
FIG. 1 is a flow diagram that illustrates a method for cross-platform migration of applets, according to one embodiment;
FIG. 2 is a block diagram that illustrates an apparatus for cross-platform migration of applets, according to an embodiment;
FIG. 3 is a block diagram that illustrates the architecture of an applet migration apparatus that is configured to migrate across platforms in one embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, fig. 1 is a schematic flow chart of an applet cross-platform migration method in an embodiment, where the applet cross-platform migration method provides steps including:
and 102, acquiring a source program file and a default conversion rule of the applet to be migrated on the first platform.
In this example, migration of the applet between the first platform and the second platform is involved, and taking migration of the applet of the wechat platform to the hundred-degree platform as an example, the first platform is the wechat platform, and the second platform is the hundred-degree platform. The source program file includes initial source code data and an initial application interface, and the default transformation rules include default grammar rules and default interface rules. Specifically, the initial source code data may include initial code describing the applet page to be migrated, the menu, the program episode. And the return result, including description information or data, of the corresponding setting of the applet to be tested can be obtained through different initial application interfaces. The default transformation rules are adapted to the development framework of the second platform, can be stored in the cloud or the local computing device, and are allowed to be called when the applet migration task is executed. For different first platforms and second platforms, a default grammar rule and a default interface rule are set in advance in a targeted manner, wherein the default grammar rule is used for converting initial source code data, and the default interface rule is used for converting the initial source code data.
And 104, converting the codes in the source program file according to a default conversion rule to obtain a standard conversion file of the applet to be migrated.
The standard conversion file comprises converted standard source code data and a standard application interface. The standard source code data is a standard form code for describing a page, a menu and a program plot of the applet to be migrated in the second platform, and the default grammar rule can convert the grammar structure of the initial source code data to obtain the standard source code data. The default interface rules may transform the interface information of the initial application interface.
In one embodiment, the step of converting the original source code data into the standard source code data by the default syntax rule is: firstly, according to different functions of the initial source code data, the initial source code data is analyzed into at least one node tree with a tree structure, wherein the node tree presents a syntactic structure of assembly language in a tree form, one node in the node tree represents one structure in the code, and the nodes can be modified, created or deleted. Then, each node on the node trees is traversed according to the hierarchical relation among the nodes, and each node is replaced according to a default grammar rule. And the replacement processing comprises replacing the node source code data according to a default grammar rule and replacing the file extension name of the folder to which the node source code data belongs. In the specific embodiment, the node tree is adopted for syntax rule conversion, so that the completeness of the initial source code data can be ensured, and the structure cannot be damaged.
The method specifically comprises the steps of determining the difference between the node source code data belonging to the script logic code segment and the script logic code segment in the second platform, determining the difference between the node source code data belonging to the style type code segment and the style type code segment in the second platform, and replacing the contents including the contents for describing the page path, the interface expression, the network timeout time and the bottom tab in the applet aiming at the difference according to default method rules, instruction rules and attribute rules. For the replacement of the file extension, taking the suffix of replacing the WeChat applet with the Baidu applet as an example, the engineering file of the Baidu applet is divided into four types of SWAN, CSS, JS and JSON, wherein the CSS is similar to the WXSS file of the WeChat applet. WXSS has most of the characteristics of CSS, and WXSS adds a size unit which is different from CSS in grammatical aspects such as logic judgment, circulation and the like. And replacing all the WXSS files with CSS files based on the node tree. And finally, outputting the node tree after the replacement processing into standard source code data of a standard conversion file.
In another embodiment, the step of converting the initial application interface into the standard application interface by the default interface rule comprises: the method comprises the steps of firstly obtaining initial mapping information of an initial application interface, wherein the initial mapping information comprises two groups of values, one group of values is an input initial parameter value, and the other group of values is an initial return result value. There is a one-to-one mapping between the initial parameter values and the initial return result values, i.e. by specifying the initial parameter values, a unique and certain initial return result value can always be found. And then obtaining standard mapping information of the standard application interface, wherein the standard mapping information also comprises standard parameter values and standard return result values which are in one-to-one correspondence and have mapping relations, similar to the initial mapping information. Then, in order to establish a default interface rule of the initial application interface and the standard application interface, when only the initial parameter value is the same as the standard parameter value, establishing a default interface rule of the initial return result value and the standard return result value; and establishing a default interface rule of the initial parameter value and the standard parameter value when only the initial return result value is the same as the standard return result value. And finally, according to the mapping relation between the parameter values determined by the default interface rule, returning the mapping relation between the result values to convert the initial application interface into the standard application interface.
And 106, acquiring a platform conversion rule of the second platform, dividing the components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule, and converting the components to be converted according to the platform conversion rule to obtain a platform conversion file of the applet to be migrated.
The platform conversion rule is a conversion rule set for proprietary functions designed by different platforms. When software is developed, program developers can design different special functions considering different audience groups of different platforms, for example, in a platform with minors as main audience groups, an anti-addiction reminding function is usually added. In order to enable the applet to be migrated to meet the specific function requirement of the platform to be migrated, the standard conversion file is further converted into the platform conversion file in the embodiment. Specifically, common functions in the applet to be migrated and the target applet are determined according to the platform conversion rule, and for example, a store function and an aiming function exist for the shooting program before and after migration. And taking the components for realizing the general functions in the standard conversion file as reserved components, and not further converting the reserved components. And dividing the rest components into components to be converted, and further converting according to the platform conversion rule.
In a specific embodiment, the component to be converted is replaced according to the replacement rule. The functional components belong to the same functional category, but the specific functions of the functional components in the second platform are not matched with the specific functions realized in the second platform, and the functional components are to-be-converted components needing to be replaced. For example, when a user logs in a program store of the second platform and the second platform respectively, and there is a difference in background, commodity type and commodity quantity, the store functional component is a component to be converted that needs to be replaced, and the code segment with the difference is replaced with a code segment conforming to the original function on the second platform.
In addition, the components to be converted are upgraded according to the upgrading rules. The specific functions of the functional components which belong to the same function category but are supported by the second platform cannot meet the proprietary functions of the second platform, and the functional components are to-be-converted components which need to be upgraded. For example, the functional components in the second platform can perform program-time reminding, but the functional components in the second platform cannot realize anti-addiction reminding and anti-addiction limitation. And upgrading the code segments with the function differentiation into the code segments conforming to the proprietary functions on the second platform.
Each platform translation rule may be stored locally on the electronic device or in other storage devices associated with the electronic device; correspondingly, when needed, the platform conversion rule corresponding to the platform to be published is searched and obtained from the electronic equipment locally or other storage equipment associated with the electronic equipment.
And step 108, acquiring a developer tool, and generating the target applet on the second platform according to the developer tool and the platform conversion file.
Specifically, the developer tool is used for acquiring an original file name and an original directory path of the applet to be migrated, and the platform conversion file records a release file name and a release directory path of the target applet. In practical application, the conversion interface of the small program can be provided for the user, so that the user can select or correct the original file name, the original directory path, the published file name and the published directory path of the small program on the conversion interface of the small program. To reduce the debugging work of developers, it should be ensured that the original file name is consistent with the published file name, and the original directory path is consistent with the published directory path.
And compiling the platform conversion file by the developer tool to generate a compiled file, so that the assembly language file is converted into a binary language executable file which can be recognized by a computer. And then the developer tool packs the compiled file, outputs the packed file to a release directory path of the target small program to generate the target small program, and releases the target small program on a platform to be released for a user to use.
Further, in order to implement synchronous update between different platforms, when update occurs in the second platform, global variables, such as a Request method variable (Request), a Storage method variable (Storage), and the like, included in a source program file of the applet to be migrated are acquired. And redefining the variables in the platform conversion file of the target applet according to the global variables to enable the variables to be compatible with the environment of the second platform, so that the applet of the second platform is updated and the target applets of other second platforms are updated at the same time.
According to the cross-platform migration method for the small program, codes in the source program file are converted according to the acquired default conversion rule so as to obtain a standard conversion file of the small program to be migrated, and the default content of the small program to be migrated can meet the requirements of a second platform. And further converting the standard conversion file according to the platform conversion rule of the second platform so as to fill the specific proprietary function of the second platform. And finally, completing the generation and the release of the target small program through a developer tool. According to the invention, the redevelopment of the small program codes for different second platforms is not needed, the difference of the small programs among different platforms is smoothed, and the migration efficiency of the small programs is improved.
In one embodiment, as shown in fig. 2, an applet migration apparatus across platforms is provided, the apparatus comprising:
an obtaining module 202, configured to obtain a source program file and a default conversion rule of an applet to be migrated on a first platform;
the standard conversion module 204 is configured to convert codes in the source program file according to a default conversion rule to obtain a standard conversion file of the applet to be migrated;
the platform conversion module 206 is configured to obtain a platform conversion rule of the second platform, divide the components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule, and convert the components to be converted according to the platform conversion rule to obtain a platform conversion file of the applet to be migrated;
and the program generating module 208 is configured to obtain a developer tool, and generate a target applet on the second platform according to the developer tool and the platform conversion file.
The applet cross-platform migration device converts the codes in the source program file according to the acquired default conversion rule to obtain a standard conversion file of the applet to be migrated, so that the default content of the applet to be migrated can meet the second platform. And further converting the standard conversion file according to the platform conversion rule of the second platform so as to fill the specific proprietary function of the second platform. And finally, completing the generation and the release of the target small program through a developer tool. According to the invention, the redevelopment of the small program codes for different second platforms is not needed, the difference of the small programs among different platforms is smoothed, and the migration efficiency of the small programs is improved.
In an embodiment, the standard conversion module 204 is further specifically configured to: converting the initial source code data into standard source code data of a standard conversion file according to a default grammar rule; and converting the initial application interface into a standard application interface of a standard conversion file according to a default interface rule.
In an embodiment, the standard conversion module 204 is further specifically configured to: parsing the initial source code data into at least one tree of nodes in a tree structure; and traversing each node on the node tree, performing replacement processing on each node according to a default grammar rule, and outputting the node tree after the replacement processing as standard source code data of a standard conversion file.
In an embodiment, the standard conversion module 204 is further specifically configured to: : and after node source code data of one node are read, replacing the node source code data according to a default grammar rule and replacing the file extension name of the folder to which the node source code data belong.
In an embodiment, the platform conversion module 206 is further specifically configured to: determining a general function in the applet to be migrated according to a platform conversion rule, taking a component for realizing the general function in the standard conversion file as a reserved component, and dividing the rest components into components to be converted.
In an embodiment, the platform conversion module 206 is further specifically configured to: carrying out replacement processing on the component to be converted according to the replacement rule; or, upgrading the component to be converted according to the upgrading rule.
In one embodiment, the applet migrating apparatus further comprises an updating module for: and acquiring global variables contained in the source program file of the applet to be migrated, and updating the platform conversion file of the target applet according to the global variables.
FIG. 3 illustrates an internal block diagram of an applet migration device across platforms in one embodiment. As shown in fig. 3, the applet migration apparatus includes a processor, a memory and a network interface connected through a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the applet cross-platform migration apparatus stores an operating system, and may further store a computer program, and when the computer program is executed by the processor, the computer program may cause the processor to implement the applet cross-platform migration method. The internal memory may also have stored therein a computer program that, when executed by the processor, causes the processor to perform the applet cross-platform migration method. Those skilled in the art will appreciate that the architecture shown in fig. 3 is merely a block diagram of a portion of the architecture associated with the subject application and does not constitute a limitation on the applet cross-platform migration apparatus to which the subject application is applied, and that a particular applet cross-platform migration apparatus may include more or fewer components than shown, or combine certain components, or have a different arrangement of components.
An applet cross-platform migration apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the following steps when executing the computer program: acquiring a source program file and a default conversion rule of the applet to be migrated on the first platform; converting codes in the source program file according to a default conversion rule to obtain a standard conversion file of the applet to be migrated; acquiring a platform conversion rule of a second platform, dividing components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule, and converting the components to be converted according to the platform conversion rule to obtain a platform conversion file of the applet to be transferred; and acquiring a developer tool, and generating the target applet on the second platform according to the developer tool and the platform conversion file.
In one embodiment, converting code in the source program file according to default conversion rules includes: converting the initial source code data into standard source code data of a standard conversion file according to a default grammar rule; and converting the initial application interface into a standard application interface of a standard conversion file according to a default interface rule.
In one embodiment, converting the initial source code data into standard source code data of a standard conversion file according to a default grammar rule includes: parsing the initial source code data into at least one tree of nodes in a tree structure; and traversing each node on the node tree, performing replacement processing on each node according to a default grammar rule, and outputting the node tree after the replacement processing as standard source code data of a standard conversion file.
In one embodiment, the replacement processing for each node according to the default grammar rule includes: and after node source code data of one node are read, replacing the node source code data according to a default grammar rule and replacing the file extension name of the folder to which the node source code data belong.
In one embodiment, dividing the components in the standard conversion file into the components to be converted and the reserved components according to the platform conversion rules comprises: determining a general function in the applet to be migrated according to a platform conversion rule, taking a component for realizing the general function in the standard conversion file as a reserved component, and dividing the rest components into components to be converted.
In one embodiment, the platform transformation rules include replacement rules and upgrade rules, and the transformation of the component to be transformed according to the platform transformation rules includes: carrying out replacement processing on the component to be converted according to the replacement rule; or, upgrading the component to be converted according to the upgrading rule.
In one embodiment, after generating the target applet on the second platform from the developer tool and the platform transformation file, the method further comprises: and acquiring global variables contained in the source program file of the applet to be migrated, and updating the platform conversion file of the target applet according to the global variables.
A computer-readable storage medium storing a computer program which, when executed by a processor, performs the steps of: acquiring a source program file and a default conversion rule of the applet to be migrated on the first platform; converting codes in the source program file according to a default conversion rule to obtain a standard conversion file of the applet to be migrated; acquiring a platform conversion rule of a second platform, dividing components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule, and converting the components to be converted according to the platform conversion rule to obtain a platform conversion file of the applet to be transferred; and acquiring a developer tool, and generating the target applet on the second platform according to the developer tool and the platform conversion file.
In one embodiment, converting code in the source program file according to default conversion rules includes: converting the initial source code data into standard source code data of a standard conversion file according to a default grammar rule; and converting the initial application interface into a standard application interface of a standard conversion file according to a default interface rule.
In one embodiment, converting the initial source code data into standard source code data of a standard conversion file according to a default grammar rule includes: parsing the initial source code data into at least one tree of nodes in a tree structure; and traversing each node on the node tree, performing replacement processing on each node according to a default grammar rule, and outputting the node tree after the replacement processing as standard source code data of a standard conversion file.
In one embodiment, the replacement processing for each node according to the default grammar rule includes: and after node source code data of one node are read, replacing the node source code data according to a default grammar rule and replacing the file extension name of the folder to which the node source code data belong.
In one embodiment, dividing the components in the standard conversion file into the components to be converted and the reserved components according to the platform conversion rules comprises: determining a general function in the applet to be migrated according to a platform conversion rule, taking a component for realizing the general function in the standard conversion file as a reserved component, and dividing the rest components into components to be converted.
In one embodiment, the platform transformation rules include replacement rules and upgrade rules, and the transformation of the component to be transformed according to the platform transformation rules includes: carrying out replacement processing on the component to be converted according to the replacement rule; or, upgrading the component to be converted according to the upgrading rule.
In one embodiment, after generating the target applet on the second platform from the developer tool and the platform transformation file, the method further comprises: and acquiring global variables contained in the source program file of the applet to be migrated, and updating the platform conversion file of the target applet according to the global variables.
It should be noted that the method, the apparatus, the device and the computer-readable storage medium for migrating an applet across platforms belong to a general inventive concept, and the contents in the embodiments of the method, the apparatus, the device and the computer-readable storage medium for migrating an applet across platforms may be mutually applicable.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A method for migration of applets across platforms, the method comprising:
acquiring a source program file and a default conversion rule of the applet to be migrated on the first platform;
converting codes in the source program file according to the default conversion rule to obtain a standard conversion file of the applet to be migrated;
acquiring a platform conversion rule of a second platform, dividing components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule, and converting the components to be converted according to the platform conversion rule to obtain a platform conversion file of the applet to be migrated;
and acquiring a developer tool, and generating the target applet on the second platform according to the developer tool and the platform conversion file.
2. The method of claim 1, wherein the source program file comprises initial source code data and an initial application interface, and wherein the default transformation rules comprise default syntax rules and default interface rules;
the converting the codes in the source program file according to the default conversion rule comprises:
converting the initial source code data into standard source code data of the standard conversion file according to the default grammar rule;
and converting the initial application interface into a standard application interface of the standard conversion file according to the default interface rule.
3. The method of claim 2, wherein converting the initial source code data into standard source code data of the standard conversion file according to the default syntax rules comprises:
parsing the initial source code data into at least one tree of nodes in a tree structure;
and traversing each node on the at least one node tree, performing replacement processing on each node according to the default grammar rule, and outputting the node tree after the replacement processing as standard source code data of the standard conversion file.
4. The method of claim 3, wherein said performing replacement processing on each node according to the default syntax rules comprises:
and after reading the node source code data of one node, replacing the node source code data according to the default grammar rule, and replacing the file extension name of the folder to which the node source code data belongs.
5. The method of claim 1, wherein the dividing the components in the standard conversion file into components to be converted and reserved components according to the platform conversion rules comprises:
determining a general function in the applet to be migrated according to the platform conversion rule, taking a component for realizing the general function in the standard conversion file as the reserved component, and dividing the rest components into the components to be converted.
6. The method of claim 1, wherein the platform transformation rules include replacement rules and upgrade rules, and the transforming the component to be transformed according to the platform transformation rules includes:
replacing the component to be converted according to a replacement rule; or the like, or, alternatively,
and upgrading the component to be converted according to an upgrading rule.
7. The method of claim 1, further comprising, after the generating a target applet at the second platform from the developer tool and the platform transformation file:
and acquiring a global variable contained in a source program file of the applet to be migrated, and updating the platform conversion file of the target applet according to the global variable.
8. An applet migration apparatus, comprising:
the acquisition module is used for acquiring a source program file and a default conversion rule of the applet to be migrated on the first platform;
the standard conversion module is used for converting codes in the source program file according to the default conversion rule to obtain a standard conversion file of the applet to be migrated;
the platform conversion module is used for acquiring a platform conversion rule of a second platform, dividing components in the standard conversion file into components to be converted and reserved components according to the platform conversion rule, and converting the components to be converted according to the platform conversion rule to obtain a platform conversion file of the applet to be transferred;
and the program generation module is used for acquiring a developer tool and generating the target small program on the second platform according to the developer tool and the platform conversion file.
9. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 7.
10. An applet cross-platform migration apparatus comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011547875.5A CN112527415A (en) | 2020-12-23 | 2020-12-23 | Method, device, equipment and medium for migrating applets across platforms |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011547875.5A CN112527415A (en) | 2020-12-23 | 2020-12-23 | Method, device, equipment and medium for migrating applets across platforms |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112527415A true CN112527415A (en) | 2021-03-19 |
Family
ID=74976672
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011547875.5A Pending CN112527415A (en) | 2020-12-23 | 2020-12-23 | Method, device, equipment and medium for migrating applets across platforms |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112527415A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113312055A (en) * | 2021-05-28 | 2021-08-27 | 支付宝(杭州)信息技术有限公司 | Applet launching method, device and equipment |
CN113448619A (en) * | 2021-06-29 | 2021-09-28 | 上海达梦数据库有限公司 | Cross-platform program implementation method and device, computer equipment and storage medium |
CN113672224A (en) * | 2021-08-20 | 2021-11-19 | 上海哔哩哔哩科技有限公司 | Method and device for generating small program page code and computer equipment |
CN113778445A (en) * | 2021-09-15 | 2021-12-10 | 树根互联股份有限公司 | Cross-platform component generation method and device, electronic equipment and storage medium |
CN114185551A (en) * | 2022-02-17 | 2022-03-15 | 浙江口碑网络技术有限公司 | Applet compiling method, applet running method and device and storage medium |
CN114610385A (en) * | 2022-03-16 | 2022-06-10 | 山东福生佳信科技股份有限公司 | Operating environment adaptation system and method |
WO2024011825A1 (en) * | 2022-07-14 | 2024-01-18 | 中国银联股份有限公司 | System, method and apparatus for introducing applet into third-party app, and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110968325A (en) * | 2019-10-28 | 2020-04-07 | 苏宁云计算有限公司 | Applet conversion method and device |
CN111381825A (en) * | 2020-03-06 | 2020-07-07 | 北京五八信息技术有限公司 | Method and device for generating small program |
CN111610978A (en) * | 2020-05-19 | 2020-09-01 | 中国建设银行股份有限公司 | Applet conversion method, device, equipment and storage medium |
CN111796829A (en) * | 2020-05-19 | 2020-10-20 | 北京三快在线科技有限公司 | Applet updating method and device, electronic equipment and computer readable storage medium |
-
2020
- 2020-12-23 CN CN202011547875.5A patent/CN112527415A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110968325A (en) * | 2019-10-28 | 2020-04-07 | 苏宁云计算有限公司 | Applet conversion method and device |
CN111381825A (en) * | 2020-03-06 | 2020-07-07 | 北京五八信息技术有限公司 | Method and device for generating small program |
CN111610978A (en) * | 2020-05-19 | 2020-09-01 | 中国建设银行股份有限公司 | Applet conversion method, device, equipment and storage medium |
CN111796829A (en) * | 2020-05-19 | 2020-10-20 | 北京三快在线科技有限公司 | Applet updating method and device, electronic equipment and computer readable storage medium |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113312055A (en) * | 2021-05-28 | 2021-08-27 | 支付宝(杭州)信息技术有限公司 | Applet launching method, device and equipment |
CN113312055B (en) * | 2021-05-28 | 2023-02-24 | 支付宝(中国)网络技术有限公司 | Applet launching method, device and equipment |
CN113448619A (en) * | 2021-06-29 | 2021-09-28 | 上海达梦数据库有限公司 | Cross-platform program implementation method and device, computer equipment and storage medium |
CN113672224A (en) * | 2021-08-20 | 2021-11-19 | 上海哔哩哔哩科技有限公司 | Method and device for generating small program page code and computer equipment |
CN113778445A (en) * | 2021-09-15 | 2021-12-10 | 树根互联股份有限公司 | Cross-platform component generation method and device, electronic equipment and storage medium |
CN114185551A (en) * | 2022-02-17 | 2022-03-15 | 浙江口碑网络技术有限公司 | Applet compiling method, applet running method and device and storage medium |
CN114610385A (en) * | 2022-03-16 | 2022-06-10 | 山东福生佳信科技股份有限公司 | Operating environment adaptation system and method |
CN114610385B (en) * | 2022-03-16 | 2023-05-09 | 山东福生佳信科技股份有限公司 | Running environment adaptation system and method |
WO2024011825A1 (en) * | 2022-07-14 | 2024-01-18 | 中国银联股份有限公司 | System, method and apparatus for introducing applet into third-party app, and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112527415A (en) | Method, device, equipment and medium for migrating applets across platforms | |
CN109032662B (en) | Code file generation method and device, computer equipment and storage medium | |
CN111679965A (en) | Automatic testing method and device, computer equipment and storage medium | |
CN112394942B (en) | Distributed software development compiling method and software development platform based on cloud computing | |
CN111176717B (en) | Method and device for generating installation package and electronic equipment | |
CN109032631B (en) | Application program patch package obtaining method and device, computer equipment and storage medium | |
CN109597618B (en) | Program development method, program development device, computer device, and storage medium | |
CN111610978A (en) | Applet conversion method, device, equipment and storage medium | |
CN111880777A (en) | Program information issuing method and device and electronic equipment | |
CN113672224A (en) | Method and device for generating small program page code and computer equipment | |
CN110362792B (en) | Method and device for converting RN file into applet file and conversion equipment | |
CN113515303B (en) | Project transformation method, device and equipment | |
CN114064114A (en) | Dynamic library generation method and device | |
US9244706B2 (en) | Command line shell command generation based on schema | |
CN114611714B (en) | Model processing method, device, system, electronic equipment and storage medium | |
CN116414774A (en) | File migration method, device, equipment and storage medium | |
CN114398912A (en) | Language processing method, device, equipment and storage medium | |
CN115098158A (en) | SDK packaging method and device, computer equipment and storage medium | |
CN111143790B (en) | Code obfuscation method, device, equipment and storage medium | |
CN115048082A (en) | Micro front-end system construction method and device, server and readable storage medium | |
CN111367512B (en) | Method and device for creating Android library module dependency relationship in application development | |
JP7059757B2 (en) | API processing method, terminal, API processing program | |
CN113608748A (en) | Data processing method, device and equipment for converting C language into Java language | |
CN114253595A (en) | Code warehouse management method and device, computer equipment and storage medium | |
CN115543486B (en) | Server-free computing oriented cold start delay optimization method, device and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210319 |
|
RJ01 | Rejection of invention patent application after publication |