CN109976793B - Application program running method, device, equipment and medium - Google Patents

Application program running method, device, equipment and medium Download PDF

Info

Publication number
CN109976793B
CN109976793B CN201910198278.7A CN201910198278A CN109976793B CN 109976793 B CN109976793 B CN 109976793B CN 201910198278 A CN201910198278 A CN 201910198278A CN 109976793 B CN109976793 B CN 109976793B
Authority
CN
China
Prior art keywords
program
compiling
identified
source code
client
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
CN201910198278.7A
Other languages
Chinese (zh)
Other versions
CN109976793A (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910198278.7A priority Critical patent/CN109976793B/en
Publication of CN109976793A publication Critical patent/CN109976793A/en
Application granted granted Critical
Publication of CN109976793B publication Critical patent/CN109976793B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running

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 embodiment of the disclosure discloses an application program running method, an application program running device, application program running equipment and an application program running medium, wherein the method comprises the following steps: receiving a function change program issued by a server; adopting a programming language grammar rule configured in a client to analyze and compile the function changing program so as to generate an executable program; and operating the executable program to realize the corresponding functions. According to the technical scheme of the embodiment of the disclosure, when the function of the application program needs to be changed, the source code of the function changing program can be issued and compiled to be executed in the running process, the application program does not need to be re-issued and installed, and the interference of using the application program by a user can be reduced.

Description

Application program running method, device, equipment and medium
Technical Field
The present disclosure relates to computer program compiling and running technologies, and in particular, to a method, an apparatus, a device, and a medium for running an application program.
Background
In the prior art, it is very common to run programs with processors of various electronic devices to implement corresponding functions.
Programs that can be run by a processor are typically executable programs that require compilation of the source code of a high-level program to generate the executable program. The source code is generally in the form of a program that is easy for a programmer to understand and write, and is typically a high-level language such as JAVA, C + +, or the like. The executable program is a program for the machine to execute, and readability is poor. The tool that converts source code into an executable program is the compiler. A compiler is a program that translates "one language (usually a high-level language)" into "another language (usually a low-level language)". The compiler can be seen as a set of software code that is dedicated to translating high level programming languages.
In the prior art, source codes of application programs are compiled to form executable programs, and then installation files are formed for downloading, installing and using by user terminals. Therefore, if an application provider wants to change or add some new functions to an application, the application provider needs to modify the source code, and then send the source code to the user terminal for installation after new compilation, i.e. so-called revision upgrade. Obviously, frequent downloading and installation can interfere with normal use of users, and particularly, some functions are temporarily changed and realized in a mode of version change and upgrading, which is more inconvenient.
Disclosure of Invention
The embodiment of the disclosure provides an application program running method, an application program running device, application program running equipment and an application program running medium, so that when the application program needs to change functions, the adjustment operation of the application program is optimized, and the interference of using the application program by a user is reduced.
In a first aspect, an embodiment of the present disclosure provides an application program running method, including:
receiving a function change program issued by a server;
adopting a programming language grammar rule configured in a client to analyze and compile the function changing program so as to generate an executable program;
and operating the executable program to realize corresponding functions.
In a second aspect, an embodiment of the present disclosure further provides an application running apparatus, including:
the program receiving module is used for receiving a function change program issued by the server;
the program compiling module is used for analyzing and compiling the function changing program by adopting a programming language grammar rule configured in the client so as to generate an executable program;
and the program running module is used for running the executable program to realize corresponding functions.
In a third aspect, an embodiment of the present disclosure further provides an apparatus, including:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the running method of the application program provided by any embodiment of the disclosure.
In a fourth aspect, the embodiments of the present disclosure further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a running method of an application program provided in any embodiment of the present disclosure.
The method and the device for updating the function change program dynamically analyze and compile the function change program which is sent by the server and serves as the source code by adopting the programming language grammar rule configured in the client, so as to generate the executable program, and run the executable program, thereby achieving the purposes of increasing and changing partial functions in the motion process of the client and realizing the online updating of the executable program. The problem that a user needs to frequently download and install when the application program is changed in a mode of version changing and upgrading in the prior art is solved, the adjustment operation of the application program is simplified, and the interference of the user in using the application program is reduced.
Drawings
Fig. 1 is a flowchart of an application running method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of an application running method provided in the second embodiment of the present disclosure;
fig. 3 is a flowchart of an application running method provided in the third embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an application running device according to a fourth embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an apparatus provided in the fifth embodiment of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the disclosure and are not limiting of the disclosure. It should be further noted that, for the convenience of description, only some of the structures relevant to the present disclosure are shown in the drawings, not all of them. In the following embodiments, optional features and examples are provided in each embodiment, and various features described in the embodiments may be combined to form a plurality of alternatives, and each numbered embodiment should not be regarded as only one technical solution.
Example one
Fig. 1 is a flowchart of an application running method according to an embodiment of the present disclosure, where the embodiment is applicable to a case where a part of functions of an application installed on a client is modified, and the method may be executed by an application running apparatus, which may be configured in a terminal installed with an application client, such as a typical smart phone, a tablet computer, and the like, and the apparatus may be implemented by software and/or hardware, preferably as a part of a client program or as a separate plug-in for the client to call. As shown in fig. 1, the method specifically includes the following steps:
and step 110, receiving a function change program sent by the server.
The function changing program is a source program which is uploaded to the server by a developer and is issued by the server, needs to be analyzed and compiled at the client, and is used for changing partial functions of the installed application program. For example, the functions that can be realized by the function changing program can be changing the theme style of the user interface of the application program within a specified time period, entering a specific user interface to show a specific animation effect, displaying interface contents with regional characteristics when the user is in different regions, and the like.
In this embodiment, when a developer modifies, adds, replaces, or deletes a part of functions of an application, the developer partially modifies the source code of the application, uploads the modified source code to a server (e.g., a code management server), and then sends the modified source code to a client by the server. Optionally, the specific time for issuing the function change program to the client may be a timed issue, or an issue when receiving a user instruction. The function changing program can be used as a program patch of a client or carried in a notification instruction to issue the function changing program.
For example, before a holiday starts, the client receives a function change program uploaded to the server by a developer, and when it is detected that the current date matches the holiday date, the main program of the client calls the function change program to enable the client to display a theme style interface corresponding to the current holiday and restore the original user interface after the holiday.
The function changing program is a source code that needs to be compiled to be executable, and can be implemented by any high-level programming language, preferably combining field descriptions of the source code to facilitate compilation.
And step 120, analyzing and compiling the function changing program by adopting a programming language grammar rule configured in the client to generate an executable program.
In this embodiment, the syntax rule of the programming language may include the feature information, the predefined attribute corresponding to the feature information, and the description rule corresponding to the feature information. The characteristic information can be characteristic characters, types of the characteristic characters and corresponding logic relations among the characteristic characters; the predefined attribute corresponding to the characteristic information can be a function definition or a parameter definition; the grammar rule corresponding to the feature information may be a parsing rule, a compiling rule, a modifying rule or an existing grammar form.
The executable program is a binary executable program which can be positioned in a floating mode in the storage space of an operating system, can be loaded into a memory and loaded and executed by the operating system to realize corresponding functions.
The client is pre-configured with a special programming language grammar rule, the content of the programming language grammar rule can be modified according to a modification instruction issued by the server, after the client receives the function modification program issued by the server, the function modification program is analyzed and compiled according to the programming language grammar rule configured in the current client, a high-level language source code issued by the server is analyzed and converted into information which can be compiled by a compiling rule, and then the information is compiled according to the compiling rule, so that a machine language which can be executed by a terminal processor is generated, and the function of the modified or added application program is realized.
Illustratively, a section of the source program in the function modification program issued by the server is in the following form:
switch(condition){
case1……;
case2……;
}
wherein, switch is a reserved keyword with specific function meaning in the source code, condition is a character string expressing the setting condition, after case1 and case2, is a code segment executing the setting function, "(" and other symbols are without function meaning).
For such code segments in the source program, the following form can be described according to the description rules preset in the syntax rules of the programming language:
token(switch),ast(condition),ast(block),sep(“(”)。
therefore, the program is decoded according to the meaning predefined by the characteristic information, the keywords in the high-level language are read according to the specification of token, the character string contents corresponding to the keywords are read according to ast, and the useless symbols are read according to sep. The description rules can be added, deleted and modified flexibly, and other description rules can also exist, such as maybe () for representing possible contents and the like.
According to the description rule, if the key word is read as the switch, the character string associated with the key word is identified according to the logic rule of the code segment where the switch is located, namely, the content of the condition is identified, and thus, a code capable of reading the switch is generated. Correspondingly, for different contents such as keywords, character strings, symbols and the like, the contents are interpreted and compiled according to the preset meanings and the preset compiling rules corresponding to the characteristic information, so that corresponding executable codes are generated.
The compiling of the function changing program can be a machine language which can be read and understood by a computer and is converted from a high-level language such as JAVA or C + +. The machine language can run the executable program on the client, so that the function of the application installed on the client is changed.
And step 130, running the executable program to realize corresponding functions.
In the embodiment of the present disclosure, after the function modification program is analyzed and compiled, an executable program is generated, and if it is detected that the operating condition of the function modification program is satisfied, the client terminal device operates the executable program to implement the function corresponding to the program.
Illustratively, the server issues a function change program for showing a specific animation effect on a specific function interface to the client, and when the client detects that a user enters the specific function interface, that is, the running condition of the function change program is met, the corresponding executable program is run, so that the function of showing the specific animation effect when entering the specific function interface is realized.
According to the technical scheme of the embodiment, the function changing program which is used as the source code is analyzed and compiled by receiving the function changing program sent by the server and adopting a programming language grammar rule configured in the client so as to generate an executable program, and the executable program is operated to realize the corresponding function. The problem that the user needs to download and install when the functions of the application program are increased and changed every time is solved, and the application experience of the user is improved.
Example two
Fig. 2 is a flowchart of an application running method provided in the second embodiment of the present disclosure, and this embodiment further details on the basis of the above embodiments, and provides specific steps for a client to parse and compile a function modification program and receive a programming language grammar rule modification instruction issued by a server. An operation method of an application provided in the second embodiment of the present disclosure is described below with reference to fig. 2, which specifically includes the following steps:
and step 210, receiving a function change program sent by the server.
Step 220, identifying a combinator in the function change program by using a programming language grammar rule configured in the client.
The combination sub is a set of words with specific meanings and compiling rules which are pre-configured in the client, the function of the combination sub is to provide a set of specific rules, and a source program compiler is generated according to the rules, so that the function change program sent by the server is interpreted and compiled.
After the client receives the function changing program sent by the server, in order to enable the client to accurately analyze the function changing program, a combination sub in the function changing program is identified according to a programming language grammar rule configured by the client, and the function changing program is analyzed according to a preset function corresponding to the combination sub.
Optionally, the combinators include at least the following categories:
the key word combiner is used for representing that the corresponding character string is an instruction key word of the high-level program;
the class declaration combiner is used for representing the corresponding character strings as parameters of the set class;
and the code segment logic relation combiner is used for representing the logic hierarchical relation between at least two corresponding code segments.
The keyword combinator is used for analyzing reserved fields (keywords) specified in a high-level language code issued by the server, for example, the keywords such as new, abstrat and class in the JAVA language; the class declaration combinator is used for resolving data types corresponding to variables or constants, such as int, float, char, and pool; the code segment logical relation combinator is used for resolving the logical relation among the code segments, such as the logical relation of and, or, not, and the like. The logical relationship of the code segments can be nested with each other, and is not limited to the logical relationship of two code segments.
And step 230, compiling the program code corresponding to the combinator by adopting the corresponding compiling rule in the programming language grammar rule according to the preset meaning of the combinator so as to generate the executable program.
After the combination child in the function changing program is identified, the combination child meaning specified in the programming language grammar rule configured by the client is correspondingly identified, so that the client can read and understand the source program, and then the program code corresponding to the identified combination child is compiled by adopting the corresponding compiling rule in the programming language grammar rule to generate the executable program. Illustratively, after receiving a function modification program in JAVA or C + + language issued by a server, a client identifies a combinational subunit in the program, analyzes data types of keywords, constants or variables and logic relationships among code segments included in a source program according to a preset meaning of the combinational subunit, and compiles the function modification program according to a predefined compilation rule to generate an executable program, so that the client does not need to download and install the application program again, but can directly run the executable program after local compilation is completed, thereby realizing modification or addition of functions of the installed application program of the client.
Optionally, the described functions of the combinators are as follows:
if a keyword combination son (token) is identified from the source code, determining that a character string correspondingly described by the keyword combination son reserves keywords for the high-level program, and adopting a corresponding compiling means;
if a useless combination (sep) is identified from the source code, the corresponding character string is useless and does not need to be compiled;
if a combinator (num) of the digital entity class is identified from the source code, compiling the corresponding character string as a digital parameter;
if a string of a string entity class is identified from the source code, compiling the corresponding string as a string;
if a character entity class combinator (pool) is identified from the source code, compiling the corresponding character string as a character;
if a combined sub (id) of a variable entity class is identified from the source code, compiling the corresponding character string as a program variable;
if a combination (litea) of a literal entity class is identified from the source code, compiling the corresponding character string as the literal;
if an upper layer combination sub (ast) is identified from the source code, determining that a nesting relation exists between input codes corresponding to the upper layer combination sub, and compiling according to the nesting relation;
if a child (or) is identified or combined from the source code, determining that two corresponding segments of codes are two child abstract syntax trees, and compiling according to a parallel relation, wherein the two child abstract syntax trees have the parallel relation;
if a possible combinator (maybe) is identified from the source code, determining that the corresponding code segment is possible to be executed, and compiling according to a possible relation;
deleting the corresponding code segment if a delete composition child (option) is identified from the source code;
if a duplicate composition child (repeat) is identified from the source code, compiling is repeated one to many times for the corresponding code segment;
if a retry combination (prefix) is identified from the source code, indicating that the prefixes of the at least two abstract syntax tree code segments are the same, and compiling it can be retried and rolled back multiple times;
compiling as a binary operation expression if a binary composer (Expr) is identified from the source code;
if the rewrite combination sub-logic (insertChoice) is identified from the source code, the rewrite combination sub-logic indicates that the section of code can be compiled according to other grammar results by inserting other grammar results when the section of code is operated;
if a limited number of combinations (times) are identified from the source code, indicating that the corresponding code fragment can be subjected to a limited number of matching compilations;
if at least a child of a composition (least) is identified from the source code, indicating a minimum number n of times that the corresponding code segment can be matched;
if the source code is identified to a multi-composition child (most), indicating the maximum number m of times that the corresponding code segment can be matched;
if a scope combine sub (range) is identified from the source code, it indicates the range of times the corresponding code segment can be matched.
And 240, receiving a modification instruction of the programming language grammar rule sent by the server, and modifying at least one of the combination sub, the preset meaning of the combination sub and the compiling rule of the combination sub in the programming language grammar rule according to the modification instruction.
In this embodiment, the meaning and the compiling rule corresponding to the combinators and the combinators can be added or deleted and modified according to the actual situation. For example, when information (e.g., a new keyword or a logical relationship) other than the syntax rule of the programming language configured by the current client appears in the function modification program, a new combinator may be added according to actual needs, and meanwhile, the preset meaning and the compiling rule of the combinator may be modified accordingly, so that the combinator is more flexibly adapted to different language environments.
It is understood that step 240 may occur at any time in the above embodiments, the execution sequence is flexibly adjusted according to the actual situation, in the actual application, the modified program may be analyzed and compiled according to the modified programming language grammar rule after receiving the programming language grammar rule modification instruction sent by the server before analyzing and compiling the modified program, or the modified program may be analyzed and compiled after receiving the programming language grammar rule modification instruction sent by the server after analyzing and compiling the modified program, so that the modified programming language grammar rule is analyzed and compiled after receiving the function modified program next time.
And step 250, running the executable program to realize corresponding functions.
According to the technical scheme of the embodiment, on one hand, the combination in the function changing program and the corresponding preset meanings of the combination are adopted, the corresponding compiling rules in the programming language grammar rules are adopted to directly compile the program codes corresponding to the combination at the client, the changed functions are realized, the user does not need to repeatedly download and install the changed application program, and the user experience is improved. On the other hand, by receiving the modification instruction sent by the server, the grammar rule of the programming language configured in the client can be flexibly adjusted, so that the client can accurately analyze and compile the function change program under different language environments.
EXAMPLE III
Fig. 3 is a flowchart of an application running method provided in the third embodiment of the present disclosure, and in this embodiment, further details are provided on the basis of the foregoing embodiments, and specific steps are provided before analyzing and compiling the function modification program after receiving the function modification program issued by the server. An operation method of an application program provided by a third embodiment of the present disclosure is described below with reference to fig. 3, which further includes the following steps:
and step 310, receiving a function change program sent by the server.
And step 320, determining the time for the function changing program to be called and run by the main program of the client according to the running conditions in the function changing program.
The functionality modification program may make permanent changes to the client application, but may also be short-term changes. Therefore, the running can be compiled by setting the running condition to call the function changing program when the running opportunity is met. The operation conditions are selectable mainly by time, location, setting function, user group, and the like, but are not limited thereto.
The action time period of the function modification program issued by the server may be a specified time period or a long time period (for example, the application home page shows a specific animation effect in a specified time period, the animation effect is not shown after exceeding the specified time period, or a new function module is added to the application and is used all the time later), and therefore, the operation condition may be that the function modification program operates in the specified time period, operates in a specified geographical position or a specified interface of the application, and operates after a user issues a corresponding instruction. And when the condition that the running condition is met is detected, calling the function changing program by the client main program to realize the corresponding function.
Optionally, the operating conditions include at least one of:
detecting a calling instruction within a preset time range;
detecting a calling instruction within a preset position range;
detecting a calling instruction in the process of realizing a preset function;
wherein, the calling instruction is generated by user input or automatically generated by the client running process.
For example, the running condition of the function changing program includes, but is not limited to, calling the function changing program to implement a corresponding function (e.g., changing a front-end page animation effect or changing an interface function layout) whenever a user performs a specific operation (e.g., clicking a specific button or entering a specific function page) within a specific time period (e.g., a holiday or a user anniversary); in the running process of the application program, when the change of the region where the user is located is detected, the main program automatically calls a function changing program to realize a corresponding function (for example, displaying related information of different regions or pushing information related to the regions); when a user performs specific operation on a specific function interface of an application program, a function updating program is called to realize a corresponding function.
Step 330, in the running process of any existing program in the client, if it is detected that the running condition of the function changing program is met, reading the function changing program.
When the user uses the application program process installed on a certain client, the operation conditions of the function modification program issued by the server are detected, and if the operation conditions are detected to be in accordance with any operation conditions given in the step 320, the function modification program issued by the server is read.
For example, the function of the function changing program issued by the server is to change the application program installed on the client into a theme style related to the holiday on the holiday day, and at this time, the running condition of the function changing program is that the program is executed when a call instruction is detected within a preset time range. Therefore, on the holiday, when the user opens the application program, the function changing program is called to realize the function of displaying the specific theme style when the current time is detected to be within the specified time range, namely the running condition of the function changing program is met.
Step 340, adopting the syntax rule of the programming language configured in the client to analyze and compile the function changing program so as to generate an executable program.
And step 350, running the executable program to realize corresponding functions.
According to the technical scheme of the embodiment of the disclosure, the time when the function changing program is called by the main program of the client is determined according to the running condition of the function changing program, and the relevant information of the running condition is provided, so that the client can call the relevant function changing program in time within a preset time range and a preset position range or when receiving a user calling instruction, and the application experience of a user is improved.
Example four
Fig. 4 is a schematic structural diagram of an application running apparatus according to a fourth embodiment of the present disclosure, where the apparatus includes: a program receiving module 410, a program compiling module 420 and a program running module 430.
A program receiving module 410, configured to receive a function change program issued by a server;
a program compiling module 420, configured to parse and compile the function changing program by using a programming language grammar rule configured in the client, so as to generate an executable program;
and the program running module 430 is used for running the executable program to realize corresponding functions.
According to the technical scheme of the embodiment, the function change program issued by the server is analyzed and compiled by adopting the programming language grammar rule configured in the client, so that the executable program is generated and run, and the purposes of increasing and changing part of codes in the client and realizing the online update of the executable program are achieved. The problem that a user needs to frequently download and install when the application program is changed in a mode of version changing and upgrading in the prior art is solved, the adjustment operation of the application program is simplified, the interference of the user in using the application program is reduced, and the application experience of the user is improved.
Optionally, the program compiling module 420 is specifically configured to:
identifying a combination in the function changing program by adopting a programming language grammar rule configured in a client;
and compiling the program code corresponding to the combinator by adopting a corresponding compiling rule in the programming language grammar rule according to the preset meaning of the combinator so as to generate an executable program.
Optionally, the running device of the application further includes:
the modification instruction receiving module is used for receiving a modification instruction of a programming language grammar rule sent by the server;
and the grammar rule modification module is used for modifying at least one of the combination sub, the preset meaning of the combination sub and the compiling rule of the combination sub in the programming language grammar rule according to the modification instruction.
Optionally, after the program receiving module 410, the method further includes:
and the operation opportunity determining module is used for determining the operation opportunity of the function changing program called by the main program of the client according to the operation condition in the function changing program.
Optionally, the program compiling module 420 includes:
a program reading unit, configured to read the function change program if it is detected that an operating condition of the function change program is met in an operating process of any existing program in the client;
and the program compiling unit is used for analyzing and compiling the function changing program by adopting a programming language grammar rule configured in the client so as to generate an executable program.
Optionally, the operating condition in the function changing program includes at least one of:
detecting a calling instruction within a preset time range;
detecting a calling instruction within a preset position range;
detecting a calling instruction in the process of realizing a preset function;
wherein, the calling instruction is generated by user input or automatically generated by the client running process.
Optionally, the combinators include at least the following categories:
the key word combiner is used for representing that the corresponding character string is an instruction key word of the high-level program;
the class declaration combiner is used for representing the corresponding character strings as parameters of the set class;
and the code segment logic relation combiner is used for representing the logic hierarchical relation between at least two corresponding code segments.
Optionally, the described functions of the combinators are as follows:
if a keyword combination son (token) is identified from the source code, determining that a character string correspondingly described by the keyword combination son reserves a keyword for the high-level program, and adopting a corresponding compiling means;
if a useless combination (sep) is identified from the source code, the corresponding character string is useless and does not need to be compiled;
if a combinator (num) of the digital entity class is identified from the source code, compiling the corresponding character string as a digital parameter;
if a string of a string entity class is identified from the source code, compiling the corresponding string as a string;
if a character entity class combinator (pool) is identified from the source code, compiling the corresponding character string as a character;
if a combined sub (id) of a variable entity class is identified from the source code, compiling the corresponding character string as a program variable;
if a combination (litea) of a literal entity class is identified from the source code, compiling the corresponding character string as the literal;
if an upper layer combination sub (ast) is identified from the source code, determining that a nesting relation exists between input codes corresponding to the upper layer combination sub, and compiling according to the nesting relation;
if a son (or) is identified or combined from the source code, determining that two corresponding sections of codes are two sub abstract syntax trees, and compiling according to a parallel relation, wherein the parallel relation exists;
if a possible combinator (maybe) is identified from the source code, determining that the corresponding code segment is possible to be executed, and compiling according to a possible relation;
deleting the corresponding code segment if a delete composition child (option) is identified from the source code;
if a duplicate composition child (repeat) is identified from the source code, compiling is repeated one to many times for the corresponding code segment;
if a retry combination (prefix) is identified from the source code, indicating that the prefixes of the at least two abstract syntax tree code segments are the same, and compiling it can be retried and rolled back multiple times;
compiling as a binary operation expression if a binary composer (Expr) is identified from the source code;
if the rewrite combination sub-logic (insertChoice) is identified from the source code, the rewrite combination sub-logic indicates that the section of code can be compiled according to other grammar results by inserting other grammar results when the section of code is operated;
if a limited number of combinations (times) are identified from the source code, indicating that the corresponding code fragment can be subjected to a limited number of matching compilations;
if at least a child of a composition (least) is identified from the source code, indicating a minimum number n of times that the corresponding code segment can be matched;
if the source code is identified to a multi-composition child (most), indicating the maximum number m of times that the corresponding code segment can be matched;
if a scope combine sub (range) is identified from the source code, it indicates the range of times the corresponding code segment can be matched.
The running device of the application program provided by the embodiment of the disclosure can execute the running method of the application program provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
The application program running device provided in the embodiment of the present disclosure and the application program running method provided in any one of the first to third embodiments of the present disclosure belong to the same concept, and technical details that are not described in detail in the embodiment of the present disclosure may refer to any one of the first to third embodiments, and the embodiment of the present disclosure have the same beneficial effects.
EXAMPLE five
An electronic device is provided in the fifth embodiment of the present disclosure, and referring to fig. 5, a schematic structural diagram of an electronic device (e.g., a client or a server) 500 suitable for implementing the fifth embodiment of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, Personal Digital Assistants (PDAs), tablet computers (PADs), Portable Multimedia Players (PMPs), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the execution method of the application program of the embodiment of the present disclosure when executed by the processing device 501.
EXAMPLE six
The embodiment of the present disclosure also provides a computer readable storage medium, and the computer readable medium can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, 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), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present 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. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a function change program issued by a server; adopting a programming language grammar rule configured in a client to analyze and compile the function changing program so as to generate an executable program; and operating the executable program to realize corresponding functions.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The name of a module does not constitute a limitation to the module itself in some cases, for example, a "program receiving module" may also be described as a "module that receives at least one function change program".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (10)

1. An application program running method is applied to a client, and the method comprises the following steps:
receiving a function change program issued by a server;
adopting a programming language grammar rule configured in a client to analyze and compile the function changing program so as to generate an executable program;
running the executable program to realize corresponding functions;
adopting a programming language grammar rule configured in a client to analyze and compile the function changing program to generate an executable program, wherein the method comprises the following steps:
identifying a combinator in the function modifying program by adopting a programming language grammar rule configured in a client, wherein the combinator is a set of words with specific meanings and compiling rules which are configured in the client in advance;
and compiling the program code corresponding to the combinator by adopting a corresponding compiling rule in the programming language grammar rule according to the preset meaning of the combinator so as to generate an executable program.
2. The method of claim 1, further comprising:
receiving a modification instruction of a programming language grammar rule sent by a server;
and modifying at least one of the combinator, the preset meaning of the combinator and the compiling rule of the combinator in the programming language grammar rule according to the modifying instruction.
3. The method of claim 1, wherein after receiving the function modification program transmitted by the server, the method further comprises:
and determining the time for the function changing program to be called and run by the main program of the client according to the running conditions in the function changing program.
4. The method of claim 3, wherein parsing and compiling the functionality modification program to generate an executable program using programming language grammar rules configured in a client comprises:
in the running process of any existing program in the client, if the running condition of the function changing program is detected to be met, reading the function changing program;
and analyzing and compiling the function changing program by adopting a programming language grammar rule configured in the client so as to generate an executable program.
5. The method of claim 3, wherein the operating conditions include at least one of:
detecting a calling instruction within a preset time range;
detecting a calling instruction within a preset position range;
detecting a calling instruction in the process of realizing a preset function;
wherein, the calling instruction is generated by user input or automatically generated by the client running process.
6. The method of claim 1, wherein the combinators include at least the following categories:
the key word combiner is used for representing that the corresponding character string is an instruction key word of the high-level program;
the class declaration combiner is used for representing the corresponding character strings as parameters of the set class;
and the code segment logic relation combiner is used for representing the logic hierarchical relation between at least two corresponding code segments.
7. The method of claim 6, wherein the described functions of the combinators are as follows:
if the keyword combination son is identified from the source code, determining that the character string correspondingly described by the keyword combination son is a reserved keyword of the high-level program, and adopting a corresponding compiling means;
if a useless combination is identified from the source code, the corresponding character string is useless without compiling;
if the combinator of the digital entity class is identified from the source code, compiling the corresponding character string as a digital parameter;
if the combinator of the character string entity class is identified from the source code, compiling the corresponding character string as a character string;
if the combinator of the character entity class is identified from the source code, compiling the corresponding character string as a character;
if the combinator of the variable entity class is identified from the source code, compiling the corresponding character string as a program variable;
if the combination of the literal entity class is identified from the source code, compiling the corresponding character string as the literal;
if the upper layer combination sub is identified from the source code, determining that a nesting relation exists between input codes corresponding to the upper layer combination sub, and compiling according to the nesting relation;
if the children are identified or combined from the source code, determining that two corresponding segments of codes are two sub abstract syntax trees, and compiling according to a parallel relation, wherein the parallel relation exists;
if the possible combinations are identified from the source code, determining that the corresponding code segments are possible to be executed, and compiling according to the possible relations;
deleting the corresponding code segment if the delete composition child is identified from the source code;
if a duplicate combinator is identified from the source code, repeating the compiling of the corresponding code segment once to many times;
if a retry combination is identified from the source code, indicating that the prefixes of the at least two abstract syntax tree code segments are the same, and compiling it can be retried and rolled back multiple times;
if the binary combinator is identified from the source code, compiling as a binary operation expression;
if the rewrite combination sub-logic is identified from the source code, the rewrite combination sub-logic indicates that other grammar results can be inserted when the section of code runs, and compiling is carried out according to the other grammar results;
if the limited-time combinators are identified from the source code, the corresponding code segments can be subjected to limited-time matching compilation;
if at least a combinator is identified from the source code, indicating a minimum number n of times that the corresponding code segment can be matched;
if the source code is identified to the multi-combination son, indicating the maximum times m that the corresponding code segment can be matched;
if a scope combinator is identified from the source code, it indicates a range of times the corresponding code segment may be matched.
8. An apparatus for running an application, configured at a client, the apparatus comprising:
the program receiving module is used for receiving a function change program issued by the server;
the program compiling module is used for analyzing and compiling the function changing program by adopting a programming language grammar rule configured in the client so as to generate an executable program;
the program compiling module is specifically configured to:
identifying a combinator in the function modifying program by adopting a programming language grammar rule configured in a client, wherein the combinator is a set of words with specific meanings and compiling rules which are configured in the client in advance;
compiling the program code corresponding to the combinator by adopting a corresponding compiling rule in the programming language grammar rule according to the preset meaning of the combinator so as to generate an executable program;
and the program running module is used for running the executable program to realize corresponding functions.
9. An apparatus, characterized in that the apparatus comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method of operating an application program as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method of running an application program as claimed in any one of claims 1 to 7.
CN201910198278.7A 2019-03-15 2019-03-15 Application program running method, device, equipment and medium Active CN109976793B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910198278.7A CN109976793B (en) 2019-03-15 2019-03-15 Application program running method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910198278.7A CN109976793B (en) 2019-03-15 2019-03-15 Application program running method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN109976793A CN109976793A (en) 2019-07-05
CN109976793B true CN109976793B (en) 2022-05-10

Family

ID=67079030

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910198278.7A Active CN109976793B (en) 2019-03-15 2019-03-15 Application program running method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN109976793B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110489124B (en) * 2019-07-12 2023-06-13 浙江口碑网络技术有限公司 Source code execution method, source code execution device, storage medium and computer equipment
CN112445483B (en) * 2019-08-27 2023-11-24 龙芯中科技术股份有限公司 Instruction generation method and device, electronic equipment and storage medium
CN110990020A (en) * 2019-11-24 2020-04-10 苏州浪潮智能科技有限公司 Software compiling method and device, electronic equipment and storage medium
CN111274127B (en) * 2020-01-14 2023-04-07 北京百度网讯科技有限公司 Code jumping method, device, equipment and medium in code evaluation
CN111930398B (en) * 2020-07-24 2023-06-27 北京柠檬微趣科技股份有限公司 Application program updating method, device, system, medium and equipment
CN112486465A (en) * 2020-12-11 2021-03-12 北京字节跳动网络技术有限公司 Code updating method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101196825A (en) * 2002-08-02 2008-06-11 松下电器产业株式会社 Compiler, compiler apparatus and compilation method
CN106933610A (en) * 2015-12-30 2017-07-07 北京金山安全软件有限公司 Application program installation package generation method and device and electronic equipment
CN107133077A (en) * 2016-02-29 2017-09-05 深圳秀豹科技有限公司 A kind of page end calls the method and device of locally applied function
CN108563448A (en) * 2018-04-19 2018-09-21 清华大学 Compilation Method, system, computer equipment and the storage medium of program file

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ITTO20070915A1 (en) * 2007-12-19 2009-06-20 Antonio Remollino PROCEDURE FOR VERIFICATION OF CODES BY PROCESSOR AND ITS VERIFICATION SYSTEM

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101196825A (en) * 2002-08-02 2008-06-11 松下电器产业株式会社 Compiler, compiler apparatus and compilation method
CN106933610A (en) * 2015-12-30 2017-07-07 北京金山安全软件有限公司 Application program installation package generation method and device and electronic equipment
CN107133077A (en) * 2016-02-29 2017-09-05 深圳秀豹科技有限公司 A kind of page end calls the method and device of locally applied function
CN108563448A (en) * 2018-04-19 2018-09-21 清华大学 Compilation Method, system, computer equipment and the storage medium of program file

Also Published As

Publication number Publication date
CN109976793A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN109976793B (en) Application program running method, device, equipment and medium
EP3605324B1 (en) Application development method and tool, and storage medium thereof
CN109634598B (en) Page display method, device, equipment and storage medium
CN110764748B (en) Code calling method, device, terminal and storage medium
CN111736840A (en) Compiling method and running method of applet, storage medium and electronic equipment
CN109408354B (en) Data processing method and device for application component
CN111367516B (en) Application interface generation method and device and electronic equipment
CN112395253B (en) Index file generation method, terminal device, electronic device and medium
CN109062572B (en) Component calling method, device, equipment and storage medium
CN112817657B (en) Application program starting item loading method, device, system and storage medium
CN110960855B (en) Communication protocol code updating method and device, electronic equipment and storage medium
CN111176717A (en) Method and device for generating installation package and electronic equipment
CN110489162B (en) Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file
CN113407165B (en) SDK generation and self-upgrade method, device, readable medium and equipment
CN110442419B (en) Interface layout method and device for Android application
CN111124541B (en) Configuration file generation method, device, equipment and medium
CN110941443B (en) Method and device for modifying file name in SDK (software development kit) and electronic equipment
CN109597620B (en) Data processing method, device, equipment and storage medium
CN109491687B (en) Hot updating method and device of application software, terminal and readable medium
CN113377342A (en) Project construction method and device, electronic equipment and storage medium
CN114625373A (en) Application conversion method and device, electronic equipment and storage medium
CN111625232B (en) Method and device for generating application program installation package, readable medium and electronic equipment
CN114625372A (en) Automatic component compiling method and device, computer equipment and storage medium
CN111782196A (en) MVP architecture-based development method and device
CN112882698A (en) Development environment generation method and device, computer storage medium and electronic device

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