CN110457065B - Method and apparatus for obtaining applications compatible with multi-version systems - Google Patents

Method and apparatus for obtaining applications compatible with multi-version systems Download PDF

Info

Publication number
CN110457065B
CN110457065B CN201910752943.2A CN201910752943A CN110457065B CN 110457065 B CN110457065 B CN 110457065B CN 201910752943 A CN201910752943 A CN 201910752943A CN 110457065 B CN110457065 B CN 110457065B
Authority
CN
China
Prior art keywords
version
program
syntax tree
abstract syntax
systems
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.)
Active
Application number
CN201910752943.2A
Other languages
Chinese (zh)
Other versions
CN110457065A (en
Inventor
赵海强
罗涛
白长昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN201910752943.2A priority Critical patent/CN110457065B/en
Publication of CN110457065A publication Critical patent/CN110457065A/en
Application granted granted Critical
Publication of CN110457065B publication Critical patent/CN110457065B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure provides a method, apparatus, system, and medium for obtaining applications compatible with multi-version systems. The method comprises the steps of firstly obtaining a first abstract syntax tree of a first program running in a first version system, then expanding the first abstract syntax tree to obtain a second abstract syntax tree, wherein a second program corresponding to the second abstract syntax tree can run in the first version system and other version systems, and then obtaining the second program based on the second abstract syntax tree. Wherein the first program and the second program are different programs of the same application, and the first version system and the other version system are different versions of software systems based on the same software framework.

Description

Method and apparatus for obtaining applications compatible with multi-version systems
Technical Field
The present disclosure relates to the field of internet technology, and more particularly, to a method, apparatus, system, and medium for obtaining applications compatible with multi-version systems.
Background
The front-end and back-end separation in the related art makes the front-end engineer directly develop the front-end interface of the application program without relying on the back-end program. The backend services only need to write once when developing a new application, but may be updated continuously at the front-end application level according to the continual upgrades of the front-end system (e.g., browser) running the application. In this case, if the front-end development of the application is directed to the front-end system of the higher version, the newly developed application often cannot meet the operation of the front-end system of the lower version, resulting in a usage field Jing Shouxian of the newly developed application, and the development efficiency improvement caused by the front-end and rear-end separation cannot be enjoyed.
Disclosure of Invention
In view of this, the present disclosure provides a method, apparatus, system, and medium for obtaining applications compatible with multi-version systems.
One aspect of the present disclosure provides a method for obtaining an application compatible with a multi-version system. The method comprises the following steps: acquiring a first abstract syntax tree of a first program running in a first version system; expanding the first abstract syntax tree to obtain a second abstract syntax tree, wherein a second program corresponding to the second abstract syntax tree can run in the first version system and other version systems; and deriving the second program based on the second abstract syntax tree. Wherein the first program and the second program are different programs of the same application, and the first version system and the other version system are different versions of software systems based on the same software framework.
According to an embodiment of the disclosure, the expanding the first abstract syntax tree to obtain a second abstract syntax tree includes expanding the first abstract syntax tree to obtain the second abstract syntax tree based on a compatible syntax list of the other version system with respect to the first version system.
According to an embodiment of the disclosure, expanding the first abstract syntax tree to obtain the second abstract syntax tree based on the compatible syntax list includes adding syntax sentences corresponding to nodes in the compatible syntax list through conditional sentences in at least one node of the first abstract syntax tree to obtain the second abstract syntax tree.
According to an embodiment of the disclosure, the obtaining a first abstract syntax tree of a first program running in a first version system includes parsing code of the first program to obtain the first abstract syntax tree.
According to an embodiment of the disclosure, the deriving the second program based on the second abstract syntax tree includes converting the second abstract syntax tree into code of the second program to derive the second program.
According to an embodiment of the present disclosure, the method further comprises running the second program in the other version system.
According to an embodiment of the present disclosure, the first version system and the other version systems are different version systems of the browser, and the other version systems are lower than the first version system.
In another aspect of the present disclosure, an apparatus for obtaining an application compatible with a multi-version system is provided. The device comprises a first acquisition module, an expansion module and a second acquisition module. The first obtaining module is used for obtaining a first abstract syntax tree of a first program running in a first version system. The expansion module is used for expanding the first abstract syntax tree to obtain a second abstract syntax tree, wherein a second program corresponding to the second abstract syntax tree can be run in the first version system and other version systems. The second obtaining module is configured to obtain the second program based on the second abstract syntax tree. The first program and the second program are different programs of the same application, and the first version system and the other version systems are software systems of different versions based on the same software framework.
According to an embodiment of the disclosure, the expansion module is specifically configured to expand the first abstract syntax tree based on a compatible syntax list of the other version system with respect to the first version system, so as to obtain the second abstract syntax tree.
According to an embodiment of the disclosure, the expansion module is specifically configured to, in at least one node of the first abstract syntax tree, add, by a conditional statement, a syntax statement corresponding to the node in the compatible syntax list, so as to obtain a second abstract syntax tree.
In another aspect of the present disclosure, a system for obtaining an application compatible with a multi-version system is provided. The system includes a memory and a processor. The memory has stored thereon computer executable instructions. The processor executes the instructions to implement the method as described above.
In another aspect of the disclosure, a computer-readable storage medium is provided having stored thereon executable instructions that, when executed by a processor, cause the processor to perform a method as described above.
According to the implementation method of the application program compatible with the multi-version system, which is provided by the embodiment of the disclosure, for example, aiming at the application program developed by the front-end system of the latest version, a developer can expand codes according to the method of the embodiment of the disclosure to obtain the application program compatible with the front-end system of other versions, so that the application program can meet more use scenes.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments thereof with reference to the accompanying drawings in which:
FIG. 1 schematically illustrates application concept schematics of a method, apparatus, system and medium for obtaining applications of a compatible multi-version system according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of a method for obtaining an application of a compatible multi-version system in accordance with an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart of a method for obtaining an application of a compatible multi-version system according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a block diagram of an apparatus for obtaining an application of a compatible multi-version system, in accordance with an embodiment of the present disclosure; and
FIG. 5 schematically illustrates a block diagram of a computer system for obtaining applications of a compatible multi-version system, in accordance with an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a formulation similar to at least one of "A, B or C, etc." is used, in general such a formulation should be interpreted in accordance with the ordinary understanding of one skilled in the art (e.g. "a system with at least one of A, B or C" would include but not be limited to systems with a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Embodiments of the present disclosure provide a method, apparatus, system, and medium for obtaining applications of a compatible multi-version system. A method according to an embodiment of the present disclosure includes first obtaining a first abstract syntax tree of a first program running in a first version system, and then augmenting the first abstract syntax tree to obtain a second abstract syntax tree, wherein a second program corresponding to the second abstract syntax tree is executable on the first version system and other version systems. A second program is then derived based on the second abstract syntax tree. The first program and the second program are different programs of the same application, and the first version system and the other version systems are software systems of different versions based on the same software framework.
According to the embodiment of the disclosure, an application program developed for a certain version system can be converted into an application program compatible with other version systems by expanding program codes, so that the application program can meet more use scenes.
According to an embodiment of the present disclosure, the first version system and the other version systems are different versions of a browser. More specifically, for example, the first version system may be a high or latest version browser. The other version system is a lower browser than the first version system, such as a lower version browser. The different versions of the browser may be different versions of the IE (Internet Explorer) browser according to embodiments of the present disclosure. Thus, according to the method of the embodiment of the disclosure, the application program running in the high-version IE browser can be converted into the application program compatible with the low-version IE browser, so that the running of the application program can be compatible with the low-version IE browser, and further more application scene requirements are met.
Fig. 1 schematically illustrates application concept schematics of a method, apparatus, system and medium for obtaining applications of a compatible multi-version system according to an embodiment of the present disclosure.
As shown in fig. 1, the first program 101 and the second program 102 are different programs of the same application, respectively. The first program 101 may be run in a first version system, and the second program 102 may be compatible with a multi-version system, and may be run in the first version system or in another version system. By means of the device 103 for obtaining applications of a compatible multi-version system according to an embodiment of the present disclosure, the code of the first program 101 may be extended to obtain the second program 102.
Wherein the first version system and the other version systems are different versions of a software system based on the same software framework. For example, the first version system and the second version system may be different version systems of the same application software (such as different versions of a browser). As another example, the first version system and the second version system may be different versions of an operating system (such as different versions of windows systems (win 7, win8, or win 10), etc.).
The first version system and the second version system are described as different version systems of the browser. For example, after a developer develops a program 101 of a certain application product (for example, a life payment service) for the latest version of the browser, the code of the program 101 may be extended by the device 103 to obtain a program 102 that can also run in the browser of the first version. Thus, the user using the life payment service can use the application of the life payment service whether the latest version of the browser or the low version of the browser is installed on the terminal device. In this way, the application of the life payment service can meet more scenes, and the user experience is improved.
According to an embodiment of the present disclosure, the device 103 may parse the code of the first program 101 to obtain a first abstract syntax tree corresponding to the first program 101, and may add, according to a compatible syntax list of the other version system relative to the first version system, syntax sentences in the compatible syntax list to corresponding nodes of the first abstract syntax tree in a conditional sentence manner, so as to obtain a second abstract syntax tree. Thereafter, the second program 102 is restored according to the second abstract syntax tree. Wherein, the compatible grammar list can comprise different contents when the program runs on other version systems and when the program runs on the first version system only, and the different contents can be classified into templates, interfaces, component libraries or various logic components when the program runs.
According to an embodiment of the disclosure, the use of a Babe1 compiler may be specifically implemented in the apparatus 103 to augment the content of the corresponding node in the abstract syntax tree.
According to the method, the device, the system and the medium of the embodiment of the disclosure, codes of application programs developed in a certain software framework can be expanded, so that the application programs can be compatible with various versions of the software framework, and further, the application programs can meet more use scenes of the programs.
Fig. 2 schematically illustrates a flow chart of a method for obtaining an application of a compatible multi-version system according to an embodiment of the present disclosure.
As shown in fig. 2, the method may include operations S201 to S203.
In operation S201, a first abstract syntax tree of a first program 101 running in a first version system is acquired. An abstract syntax tree (Abstract Syntax Tree, AST) is an abstract representation of the source code syntax structure. It represents the syntax structure of a programming language in the form of a tree, each node on the tree representing a structure in the source code. In operation S201, the code of the first program 101 may be parsed to obtain a first abstract syntax tree, or a preset first abstract syntax tree may be obtained from a cloud platform or other storage location.
In operation S202, the first abstract syntax tree is extended to obtain a second abstract syntax tree, wherein a second program 102 corresponding to the second abstract syntax tree is executable on the first version system and other version systems. Wherein the first program 101 and the second program 102 are different programs of the same application. The first version system and the other version systems are different versions of the software system based on the same software framework.
According to an embodiment of the present disclosure, the first abstract syntax tree is extended to obtain a second abstract syntax tree based on a compatible syntax list of the other version system with respect to the first version system in operation S202.
The compatible grammar list may be a grammar list obtained based on grammar differences of other version systems relative to the first version system, wherein grammar contents are grammar sentences which are not found in the first version system but are necessary for running in the other version systems of the application.
The embodiment of the disclosure can add the grammar statement in the compatible grammar list to the corresponding node of the first abstract grammar tree in a conditional statement manner so as to expand the first abstract grammar tree, thereby obtaining a second abstract grammar tree.
In operation S203, the second program 102 is obtained based on the second abstract syntax tree. The second program 102 may include a program similar to "if (version >; else xx ", wherein"? "may be a specific version number in the program". In this way, the second program 102 can be compatible with the first version system and the other version system.
Thereafter, the second program 102 may be run in other version systems and/or the first version system in accordance with embodiments of the present disclosure.
In this way, the code of the application program developed for a specific version can be expanded, so that the application program can be compatible with a multi-version system, the development efficiency is improved, and the application program can be used for meeting various scenes.
Fig. 3 schematically illustrates a flow chart of a method for obtaining an application of a compatible multi-version system according to another embodiment of the present disclosure.
As shown in fig. 3, the method may include operations S301 to S303 according to an embodiment of the present disclosure.
In operation S301, the code of the first program 101 is parsed, resulting in a first abstract syntax tree. Wherein operation S301 is a specific embodiment of operation S201.
Then, in operation S302, in at least one node of the first abstract syntax tree, syntax sentences corresponding to the nodes in the compatible syntax list are added by conditional sentences to obtain a second abstract syntax tree. Wherein operation S302 is a specific embodiment of operation S202.
For example, each node of the first abstract syntax tree may be traversed, and for the node corresponding to the content of the syntax sentence in the compatible syntax list, the syntax sentence corresponding to the first version system is executed according to the condition sentence adding logic "if the syntax sentence is running under the first version system; or if the system is operated under other version systems, executing the data structure of grammar statement corresponding to the other version systems.
According to embodiments of the present disclosure, different contents of the compatible syntax list may be included when the program is running on the other version system than when the program is running on the first version system only, and the different contents may be classified as templates, interfaces, component libraries, or various logic components of the runtime. The contents of the nodes in the first abstract syntax tree corresponding to the templates, interfaces, component libraries, and/or logical elements of the compatible syntax list, and/or the runtime, may be traversed and replaced in operation S302. Code comparison of different versions of the software system can be performed at a larger granularity based on comparison of templates, interfaces, component libraries and/or runtime, and the efficiency of expanding code can be improved.
The second abstract syntax tree is then converted into the code of the second program 102 in operation S303, to obtain the second program 102. The code of the second program 102 is restored by the second abstract syntax tree. Operation S303 is a specific embodiment of operation S203.
According to an embodiment of the present disclosure, the first version system and the other version systems are different version systems of the browser, and the other version systems are lower than the first version system. In this way, after an application program is developed for a browser of a certain version, the code of the application program can be expanded, and the application program compatible with the browser of a low version can be obtained.
Fig. 4 schematically illustrates a block diagram of an apparatus 400 for obtaining an application of a compatible multi-version system, according to an embodiment of the disclosure.
As shown in fig. 4, an apparatus 400 includes a first acquisition module 410, an expansion module 420, and a second acquisition module 430, according to an embodiment of the present disclosure. Apparatus 400 may be a specific embodiment of apparatus 103. The apparatus 400 may be used to perform the methods described with reference to fig. 2 and 3.
The first obtaining module 410 is configured to obtain a first abstract syntax tree of the first program 101 running in the first version system. According to an embodiment of the present disclosure, the augmentation module 410 is specifically configured to augment the first abstract syntax tree to obtain the second abstract syntax tree based on a compatible syntax list of the other version system with respect to the first version system.
The expansion module 420 is configured to expand the first abstract syntax tree to obtain a second abstract syntax tree, wherein the second program 102 corresponding to the second abstract syntax tree is capable of running in the first version system and other version systems. According to an embodiment of the present disclosure, the augmentation module 420 is specifically configured to add, in at least one node of the first abstract syntax tree, a syntax sentence corresponding to the node in the compatible syntax list through a conditional sentence, so as to obtain a second abstract syntax tree.
The second obtaining module 430 is configured to obtain the second program 102 based on the second abstract syntax tree. Wherein the first program 101 and the second program 102 are different programs of the same application, and the first version system and the other version systems are software systems of different versions based on the same software framework.
Any number of modules, sub-modules, units, sub-units, or at least some of the functionality of any number of the sub-units according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented as split into multiple modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or in any other reasonable manner of hardware or firmware that integrates or encapsulates the circuit, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be at least partially implemented as computer program modules, which when executed, may perform the corresponding functions.
For example, any of the first acquisition module 410, the expansion module 420, and the second acquisition module 430 may be combined in one module to be implemented, or any of the modules may be split into a plurality of modules. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the first acquisition module 410, the expansion module 420, and the second acquisition module 430 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable way of integrating or packaging circuitry, or in any one of or a suitable combination of any of the three. Alternatively, at least one of the first acquisition module 410, the expansion module 420, and the second acquisition module 430 may be at least partially implemented as a computer program module, which when executed, may perform the corresponding functions.
Fig. 5 schematically illustrates a block diagram of a computer system 500 for obtaining applications of a compatible multi-version system, according to an embodiment of the disclosure. The computer system 500 shown in fig. 5 is merely an example and should not be construed as limiting the functionality and scope of use of the disclosed embodiments. Computer system 500 is one particular embodiment of device 103.
As shown in fig. 5, a computer system 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. The processor 501 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 501 may also include on-board memory for caching purposes. The processor 501 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flows according to embodiments of the disclosure.
In the RAM 503, various programs and data required for the operation of the system 500 are stored. The processor 501, ROM 502, and RAM 503 are connected to each other by a bus 504. The processor 501 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 502 and/or the RAM 503. Note that the program may be stored in one or more memories other than the ROM 502 and the RAM 503. The processor 501 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the system 500 may further include an input/output (I/O) interface 505, the input/output (I/O) interface 505 also being connected to the bus 504. The system 500 may also include one or more of the following components connected to the I/O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output portion 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 501. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 502 and/or RAM 503 and/or one or more memories other than ROM 502 and RAM 503 described above.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (7)

1. A method for obtaining an application compatible with a multi-version system, comprising:
acquiring a first abstract syntax tree of a first program running in a first version system;
expanding the first abstract syntax tree based on compatible syntax lists of other version systems relative to the first version system to obtain a second abstract syntax tree, wherein a second program corresponding to the second abstract syntax tree can run on the first version system and the other version systems; wherein the compatible grammar list is a grammar list obtained based on grammar differences of the other version systems relative to the first version system, and grammar contents are grammar sentences which are not in the first version system but are necessary for running applications in the other version systems; and
obtaining the second program based on the second abstract syntax tree;
wherein:
the first program and the second program are different programs of the same application;
the first version system and the other version systems are software systems of different versions based on the same software framework;
wherein expanding the first abstract syntax tree to obtain the second abstract syntax tree based on the compatible syntax list comprises:
in at least one node of the first abstract syntax tree, adding syntax sentences corresponding to the node in the compatible syntax list through conditional sentences to obtain a second abstract syntax tree, wherein the method comprises the following steps of: traversing each node of the first abstract syntax tree, adding logic to nodes corresponding to the syntax sentence content in the compatible syntax list according to a conditional sentence, and executing the syntax sentence corresponding to the first version system if the nodes are operated under the first version system; and if the grammar statement is operated under the other version systems, executing the data structure of grammar statement corresponding to the other version systems.
2. The method of claim 1, wherein the obtaining a first abstract syntax tree of a first program running in a first version system comprises:
and analyzing the code of the first program to obtain the first abstract syntax tree.
3. The method of claim 1, wherein the deriving the second program based on the second abstract syntax tree comprises:
and converting the second abstract syntax tree into codes of the second program to obtain the second program.
4. The method of claim 1, wherein the first version system and the other version systems are different version systems of a browser and the other version systems are lower than the first version system.
5. An apparatus for obtaining an application compatible with a multi-version system, comprising:
a first obtaining module, configured to obtain a first abstract syntax tree of a first program running in a first version system;
the expansion module is used for expanding the first abstract syntax tree to obtain a second abstract syntax tree based on a compatible syntax list of other version systems relative to the first version system, wherein a second program corresponding to the second abstract syntax tree can run on the first version system and the other version systems; wherein the compatible grammar list is a grammar list obtained based on grammar differences of the other version systems relative to the first version system, and grammar contents are grammar sentences which are not in the first version system but are necessary for running applications in the other version systems; and
a second obtaining module, configured to obtain the second program based on the second abstract syntax tree;
wherein:
the first program and the second program are different programs of the same application;
the first version system and the other version systems are software systems of different versions based on the same software framework;
the expansion module is specifically configured to:
in at least one node of the first abstract syntax tree, adding syntax sentences corresponding to the node in the compatible syntax list through conditional sentences to obtain a second abstract syntax tree, wherein the method comprises the following steps of: traversing each node of the first abstract syntax tree, adding logic to nodes corresponding to the syntax sentence content in the compatible syntax list according to a conditional sentence, and executing the syntax sentence corresponding to the first version system if the nodes are operated under the first version system; and if the grammar statement is operated under the other version systems, executing the data structure of grammar statement corresponding to the other version systems.
6. A system for obtaining applications compatible with a multi-version system, comprising:
a memory having stored thereon computer executable instructions; and
a processor executing the instructions to implement the method according to any one of claims 1-4.
7. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any of claims 1-4.
CN201910752943.2A 2019-08-14 2019-08-14 Method and apparatus for obtaining applications compatible with multi-version systems Active CN110457065B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910752943.2A CN110457065B (en) 2019-08-14 2019-08-14 Method and apparatus for obtaining applications compatible with multi-version systems

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910752943.2A CN110457065B (en) 2019-08-14 2019-08-14 Method and apparatus for obtaining applications compatible with multi-version systems

Publications (2)

Publication Number Publication Date
CN110457065A CN110457065A (en) 2019-11-15
CN110457065B true CN110457065B (en) 2023-11-07

Family

ID=68486625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910752943.2A Active CN110457065B (en) 2019-08-14 2019-08-14 Method and apparatus for obtaining applications compatible with multi-version systems

Country Status (1)

Country Link
CN (1) CN110457065B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752571A (en) * 2020-06-29 2020-10-09 广州华多网络科技有限公司 Program upgrading method, device, equipment and storage medium
CN112379917B (en) * 2020-11-19 2023-10-20 康键信息技术(深圳)有限公司 Browser compatibility improving method, device, equipment and storage medium
CN113805890A (en) * 2021-09-10 2021-12-17 中国银联股份有限公司 Method, device, terminal, system and storage medium for migrating applets across applications

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014040766A1 (en) * 2012-09-12 2014-03-20 Universite Du Luxembourg Computer-implemented method for computer program translation
CN105159715A (en) * 2015-09-01 2015-12-16 南京大学 Python code change reminding method on basis of abstract syntax tree node change extraction
WO2016163901A1 (en) * 2015-04-07 2016-10-13 Huawei Technologies Co., Ltd. An apparatus for processing an abstract syntax tree being associated with a source code of a source program
CN108345773A (en) * 2017-07-27 2018-07-31 江苏通付盾信息安全技术有限公司 Code protection method and device, electronic equipment, storage medium based on virtual machine
CN109710307A (en) * 2018-12-29 2019-05-03 深圳点猫科技有限公司 Method, the electronic equipment of abstract syntax tree are rebuild based on Python code

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942137B (en) * 2013-01-23 2017-08-25 腾讯科技(深圳)有限公司 Browser compatibility method of testing and device
US9465608B2 (en) * 2013-03-15 2016-10-11 ArtinSoft Corporation Code separation with semantic guarantees
US8984485B2 (en) * 2013-05-01 2015-03-17 International Business Machines Corporation Analysis of source code changes

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014040766A1 (en) * 2012-09-12 2014-03-20 Universite Du Luxembourg Computer-implemented method for computer program translation
WO2016163901A1 (en) * 2015-04-07 2016-10-13 Huawei Technologies Co., Ltd. An apparatus for processing an abstract syntax tree being associated with a source code of a source program
CN105159715A (en) * 2015-09-01 2015-12-16 南京大学 Python code change reminding method on basis of abstract syntax tree node change extraction
CN108345773A (en) * 2017-07-27 2018-07-31 江苏通付盾信息安全技术有限公司 Code protection method and device, electronic equipment, storage medium based on virtual machine
CN109710307A (en) * 2018-12-29 2019-05-03 深圳点猫科技有限公司 Method, the electronic equipment of abstract syntax tree are rebuild based on Python code

Also Published As

Publication number Publication date
CN110457065A (en) 2019-11-15

Similar Documents

Publication Publication Date Title
CN110457065B (en) Method and apparatus for obtaining applications compatible with multi-version systems
CN110442344B (en) Method, device, system and medium for cross-platform conversion application
US11481200B1 (en) Checking source code validity at time of code update
US10133560B2 (en) Link time program optimization in presence of a linker script
CN109542455B (en) Contract execution method, contract reduction method, device, and storage medium
CN111221521A (en) Method and device for generating log code, computer system and readable storage medium
US20160048376A1 (en) Portable binary image format (pbif) for pre-compiled kernels
US9762700B2 (en) Client-side aggregation of nested resource dependencies
US11029924B2 (en) Program optimization by converting code portions to directly reference internal data representations
US10268798B2 (en) Condition analysis
CN112988163B (en) Intelligent adaptation method, intelligent adaptation device, intelligent adaptation electronic equipment and intelligent adaptation medium for programming language
US9575750B2 (en) Generic annotation seeker
CN111177089B (en) Log processing code generation method and device, computer system and storage medium
US20180275976A1 (en) Link time optimization in presence of a linker script using path based rules
CN113821486B (en) Method and device for determining dependency relationship between pod libraries and electronic equipment
US11983090B2 (en) Setting breakpoints for source code segments enclosed by macros
US20150149987A1 (en) Method and apparatus for compiler processing for a function marked with multiple execution spaces
KR20160098794A (en) Apparatus and method for skeleton code generation based on device program structure modeling
US8561027B2 (en) Reflection capability in static programming languages
US11797277B2 (en) Neural network model conversion method server, and storage medium
CN112579096A (en) Method, device, equipment and medium for compiling and loading small program starting file
CN112379885A (en) Applet compiling method, device and equipment and readable storage medium
US20140149970A1 (en) Optimising a compilation parser for parsing computer program code in arbitrary applications
US10140538B2 (en) Computing control device, computing control method, and computer readable medium
US9853871B2 (en) Dynamic collaboration service platform and method for providing an application service at the same platform

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
GR01 Patent grant
GR01 Patent grant