CN114546410A - Code optimization method based on design mode and related equipment - Google Patents

Code optimization method based on design mode and related equipment Download PDF

Info

Publication number
CN114546410A
CN114546410A CN202210213501.2A CN202210213501A CN114546410A CN 114546410 A CN114546410 A CN 114546410A CN 202210213501 A CN202210213501 A CN 202210213501A CN 114546410 A CN114546410 A CN 114546410A
Authority
CN
China
Prior art keywords
syntax tree
code
design mode
node
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210213501.2A
Other languages
Chinese (zh)
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.)
Weikun Shanghai Technology Service Co Ltd
Original Assignee
Weikun Shanghai Technology Service 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 Weikun Shanghai Technology Service Co Ltd filed Critical Weikun Shanghai Technology Service Co Ltd
Priority to CN202210213501.2A priority Critical patent/CN114546410A/en
Publication of CN114546410A publication Critical patent/CN114546410A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design

Landscapes

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

Abstract

The application provides a code optimization method based on a design mode and related equipment, wherein the method comprises the following steps of: receiving a code optimization request aiming at a target code and uploaded by a user terminal; generating a first syntax tree according to a structural relationship between at least two code roles included by the target code, matching the first syntax tree with a preset syntax tree in a design pattern library, and determining a second syntax tree with a matching degree higher than the preset matching degree with the first syntax tree; if the second design mode in the second syntax tree is the design mode to be optimized, determining a first standard design mode according to the mapping relation between the standard design mode and the design mode to be optimized; a first design pattern of the object code is optimized according to a first standard design pattern. By adopting the method of the embodiment of the application, the design mode of the code is optimized according to the standard design mode, and the development personnel is effectively helped to carry out the code quality management work.

Description

Code optimization method based on design mode and related equipment
Technical Field
The present application relates to the field of research and development management technologies, and in particular, to a code optimization method based on a design pattern and a related device.
Background
With the high-speed development of computer technology and internet technology, the number of software and hardware development projects is more and more, and accordingly, the development workload of developers is larger and larger, so that the developers have no time to carry out code review work, and further, the code quality of the development projects has larger optimization space; in addition, in the current project development work, since the code levels of developers are uneven, the code styles of a plurality of development projects are likely to be inconsistent, which is one of the reasons that the code quality management work is difficult.
At present, code optimization tools on the market can only standardize code formats, for example, only unify and standardize format problems such as variable names and linefeed formats of codes, but cannot understand the meaning of the codes and even cannot provide constructive code optimization opinions for developers according to the design mode of the codes. Therefore, the code optimization tools on the market at present cannot effectively help developers to perform code quality management work.
Disclosure of Invention
The embodiment of the application provides a code optimization method based on a design mode and related equipment, and by implementing the embodiment of the application, a first design mode for optimizing a target code according to a first standard design mode is realized.
In a first aspect, an embodiment of the present application provides a code optimization method based on a design pattern, where the method includes:
receiving a code optimization request which is uploaded by a user terminal and aims at a target code, wherein the target code comprises a first design mode defined by at least two code roles, and the code optimization request is used for requesting to optimize the first design mode;
generating a first syntax tree according to the structural relationship between at least two code roles, matching the first syntax tree with a preset syntax tree in a design pattern library, and determining a second syntax tree with the matching degree higher than the preset matching degree with the first syntax tree, wherein the preset syntax tree comprises a plurality of preset design patterns to be optimized;
if the second design mode in the second syntax tree is the design mode to be optimized, determining a first standard design mode according to the mapping relation between the standard design mode and the design mode to be optimized;
a first design pattern of the object code is optimized according to a first standard design pattern.
In a second aspect, an embodiment of the present application provides a device for code optimization based on a design pattern, where the device includes:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a code optimization request which is uploaded by a user terminal and aims at a target code, the target code comprises a first design mode defined by at least two code roles, and the code optimization request is used for requesting to optimize the first design mode;
the matching unit is used for generating a first syntax tree according to the structural relationship between at least two code roles, matching the first syntax tree with a preset syntax tree in a design pattern library, and determining a second syntax tree with the matching degree higher than the preset matching degree with the first syntax tree, wherein the preset syntax tree comprises a plurality of preset design patterns to be optimized;
the determining unit is used for determining a first standard design mode according to the mapping relation between the standard design mode and the design mode to be optimized if the second design mode in the second syntax tree is the design mode to be optimized;
an optimization unit for optimizing a first design pattern of the object code according to a first standard design pattern.
In a third aspect, embodiments of the present application provide an electronic device, which includes a processor, a memory, and computer executable instructions stored on the memory and executable on the processor, and when the computer executable instructions are executed, the electronic device is caused to perform some or all of the steps described in any one of the methods of the first aspect of the embodiments of the present application.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon computer instructions, which, when executed on a communication apparatus, cause the communication apparatus to perform some or all of the steps as described in any one of the methods of the first aspect of the embodiments of the present application.
In a fifth aspect, the present application provides a computer program product, where the computer program product includes a computer program operable to cause a computer to perform some or all of the steps as described in any one of the methods of the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
It can be seen that, in the embodiment of the present application, a first syntax tree is generated according to a structural relationship between at least two code roles included in a target code, the first syntax tree is matched with a preset syntax tree in a design pattern library, a second syntax tree with a matching degree higher than the preset matching degree with the first syntax tree is determined, when a second design pattern in the second syntax tree is a design pattern to be optimized, a first standard design pattern is determined according to a mapping relationship between the standard design pattern and the design pattern to be optimized, and the first design pattern of the target code is optimized according to the first standard design pattern. By adopting the method of the embodiment of the application, when the design mode corresponding to the syntax tree of the target code is the design mode to be optimized, the first design mode of the target code is optimized according to the first standard design mode, so that the code design mode of the optimized target code is the standard design mode, the workload of a developer in the subsequent link of the compiling process for reading or debugging the code program is further reduced, and the developer is effectively helped to carry out code quality management work.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a block diagram of a code optimization system;
FIG. 2 is a block diagram of a code optimization system based on design patterns according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a method for code optimization based on design patterns according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a code optimization method based on a design pattern according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a code optimization method based on a design pattern according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a code optimization method based on a design pattern according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a code optimization method based on a design pattern according to an embodiment of the present application;
FIG. 8 is a block diagram of a code optimization apparatus based on design patterns according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a server in a hardware operating environment of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps is not limited to only those steps recited, but may alternatively include other steps not recited, or may alternatively include other steps inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The following describes an application scenario related to an embodiment of the present application with reference to the drawings.
FIG. 1 is a block diagram of a code optimization system. As shown in fig. 1, a first end of the system is connected to a user terminal.
The code optimization system comprises a server, a data processing module and a data processing module, wherein the server is used for receiving a code sent by a user terminal and optimizing a code format problem to obtain an optimized code, and the code format problem comprises a format problem of whether variable names are uniform and a line feed format is uniform;
the user terminal has a code review requirement, so that the written code is input into the code optimization system to perform code optimization and obtain an optimized code, as shown in fig. 1, the user terminal inputs the written target code 'into the code optimization system to obtain an optimized target code'. After the code optimization, the code format problem of the optimized target code is optimized relative to the target code, but the design mode of the code is not changed.
It can be seen that, in the process of performing code optimization on the code of the user terminal by the system, since the code optimization system only optimizes the code format problem of the code and does not optimize the design mode of the code, the system cannot substantially optimize the code quality. If different developers from the same project team use the above system to optimize their respective developed codes, the code quality of different parts of the code of the same project may be uneven, which is very disadvantageous to the quality of the project results.
Referring to fig. 2 based on the code optimization system described in fig. 1, fig. 2 is a structural diagram of a code optimization system based on a design pattern provided in an embodiment of the present application, and as shown in fig. 2, the code optimization system described in fig. 1 in the embodiment of the present application is further provided with a design pattern library, since a preset syntax tree in the design pattern library includes a plurality of preset design patterns to be optimized, a target code written by a user terminal is input into the code optimization system to obtain an optimized target code, and after code optimization, the design pattern of the code changes with respect to the target code of the optimized target code. The code optimization method based on the design mode provided by the embodiment of the application is applied to the system shown in fig. 2, and the specific implementation flow is as follows:
referring to fig. 3, fig. 3 is a flowchart of a code optimization method based on a design pattern according to an embodiment of the present application, and as shown in fig. 3, the method includes the following steps:
101: receiving a code optimization request which is uploaded by a user terminal and aims at a target code, wherein the target code comprises at least two first design modes defined by code roles, and the code optimization request is used for requesting the optimization of the first design modes.
The user terminal comprises electronic equipment such as a desktop computer, a notebook computer and a smart phone.
The design pattern is a summary of the code design experience, which is known to many people and classified and compiled, and which is repeatedly used in the code development process. The design mode is used in the code development process in order to make the code more easily understood by others and to ensure that the code has a high degree of reliability.
Generally, the design mode of the code includes 23 design modes, such as a proxy mode, a command mode, a viewer mode, a decoration mode, a strategy mode, etc., each of the 23 design modes includes a plurality of code characters, and the same code character may have different character positions in different design modes.
Different design modes correspond to different functions, so that the method is suitable for different application scenes. For example, the proxy mode refers to that an access role is not suitable or cannot directly access a target role, so that the proxy role is used as an intermediary between the access role and the target role, and the access role must access the target role through the proxy role, so that the proxy mode is suitable for an application scenario in which a client needs to be shielded from directly accessing a real object due to security reasons or other reasons; for example, the observer mode refers to that there is a one-to-many dependency relationship between a plurality of roles, and when the state of one role changes, all roles depending on it are notified and automatically updated, so the observer mode is suitable for an application scenario that needs to observe the state change of one role.
Illustratively, if the design pattern is an observer pattern, the observer pattern is a mature design pattern in which multiple characters want to know the data changes in one character. In the observer mode, there are one role called "specific topic" and several roles called "specific observer", and there is a one-to-many dependency relationship between "topic" and "specific observer", and when the state of "specific topic" changes, all "specific observers" are notified. If a project development scenario needs to develop an article subscription system, when an article is updated, a subscribing user can receive an article update notification and read the updated article, in the project development scenario, the article can be used as a "specific topic", a plurality of subscribing users can be used as "specific observers", and a design mode in which an observer mode is used as a code is used for code development of the project. With the Concrete Observer1 and Concrete Observer2 as the role variable names of "Concrete observers" and Concrete Subject as the role variable names of "Concrete topics", the code style of the Observer pattern may be:
publisher.register(Concrete Observer1);
publisher.register(Concrete Observer2);
publisher.publish(Concrete Subject);
……
wherein, the code role is a role contained in the structure of the design mode;
illustratively, if the design mode is observer mode, then the code roles include:
(1) abstract topic (Subject) role: also called abstract target class, which provides a method for holding aggregated classes of observer objects and adding, deleting observer objects, and an abstract method for notifying all observers.
(2) Specific topic (Concrete Subject) role: also called concrete object class, which implements a notification method in abstract objects to notify all registered observer objects when the internal state of a concrete topic changes.
(3) Abstract Observer (Observer) role: it is an abstract class or interface that contains an abstract method for updating itself, and is called when notified of changes to a particular topic.
(4) Specific Observer (Conscrete Observer) role: the abstract methods defined in the abstract viewer are implemented to update their state when notified of changes to the concrete topic. The specific observer includes a topic interface variable that can store the specific topic references, so that the specific observer can make the specific topic add its references to the set of specific topics, and make itself become its observer, or make the specific topic delete itself from the set of specific topics, and make itself no longer be its observer.
102: generating a first syntax tree according to the structural relationship between at least two code roles, matching the first syntax tree with a preset syntax tree in a design pattern library, and determining a second syntax tree with the matching degree higher than the preset matching degree with the first syntax tree, wherein the preset syntax tree comprises a plurality of preset design patterns to be optimized.
The syntax tree indicates a method call relationship or a function operation relationship between at least two code roles in the code, and has the function of enabling developers to grasp the context of the code, so that the developers can conveniently decode the code program in the subsequent links (such as code generation) of the compiling process.
In a specific implementation, the first syntax tree is generated according to a structural relationship between at least two code roles, and the syntax of the target code is analyzed by using a JavaCC syntax analysis generator and the syntax tree is generated according to the structural relationship between at least two code roles.
In specific implementation, the design pattern library may be a conventional design pattern library including 23 design patterns such as a command pattern, an observer pattern, a decoration pattern, and a strategy pattern, or a design pattern library formed by adding and deleting 23 design patterns according to actual project requirements by a developer to meet the project requirements.
In a specific implementation, the matching between the first syntax tree and the preset syntax trees corresponding to the multiple preset design modes to be optimized in the design mode library may be implemented by determining whether the first syntax tree belongs to a sub-tree of the preset syntax tree corresponding to the multiple preset design modes to be optimized, please refer to fig. 4, fig. 4 is a schematic diagram of a code optimization method based on the design modes provided in the embodiment of the present application, and as shown in fig. 4, the first syntax tree is a sub-tree in the second syntax tree, so that it is determined that the matching degree between the second syntax tree and the first syntax tree is higher than the preset matching degree; or by determining the node similarity between the first syntax tree and a preset syntax tree; the matching degree of the first syntax tree and the preset syntax tree can also be determined according to at least one node position of at least one node included in the first syntax tree in the preset syntax tree.
And determining a second syntax tree with a matching degree higher than a preset matching degree with the first syntax tree, wherein the aim is to indirectly determine the design mode corresponding to the first syntax tree through the design mode corresponding to the second syntax tree.
103: and if the second design mode in the second syntax tree is the design mode to be optimized, determining the first standard design mode according to the mapping relation between the standard design mode and the design mode to be optimized.
In the specific implementation, the design mode to be optimized may be an undesired design mode in which a developer considers that the code performance of the design mode does not meet the actual requirements of the project, or an undesired design mode which does not meet the code review requirements.
In the specific implementation, the standard design mode may be an expected design mode in which a developer considers that the code performance of the standard design mode meets the actual requirements of a project, or an expected design mode in which the code performance of the standard design mode meets the code review requirements.
In a specific implementation, a developer may determine the mapping relationship between the standard design mode and the design mode to be optimized according to actual project requirements.
For example, if the project requirement is to develop a notification function in the article subscription system, which can notify the subscribing user when an article is updated, whether the article is updated or not needs to be tracked in the development process, that is, it is necessary to track whether the status of the article has changed, and in order to implement this notification function, the observer mode or polling mode may be implemented as a design mode of project code, however, in practical applications, when the observer mode is used as a design mode, a subscribing user can be notified once the article status changes, when the polling mode is used as the design mode, the article state needs to be polled regularly, the subscribing user is not informed when the article state changes as a polling result, it can be seen that in order to enable a subscribing user to be notified first after an article update, it is more advantageous to use the watcher mode as the design mode. Therefore, under the actual project requirement, developers can use the polling mode as a design mode to be optimized and use the observer mode as a standard design mode, so that the situation that the developers use the polling mode which is not suitable for the project requirement to develop the project in the process of developing the project is avoided, and the code development quality of the project is further guaranteed.
104: a first design pattern of the object code is optimized according to a first standard design pattern.
In a specific implementation, the first design mode of the target code is optimized according to the first standard design mode, and the first design mode of the target code may be modified into the first standard design mode, or a reference sample of the first standard design mode may be provided to a developer and the developer determines whether to accept the modification.
The first design mode of the target code is optimized according to the first standard design mode, the aim is to ensure that the design mode of the target code is necessarily the standard design mode, and the subsequent links of a developer in the compilation process can conveniently debug, extend and the like the target code according to the technical standards corresponding to the standard design mode, so that the burden of the developer on the code quality management work is reduced.
Illustratively, as shown in fig. 4, the code optimization system includes a server and a design pattern library, a user terminal uploads a code optimization request for an object code to the code optimization system in order to optimize a polling pattern of the object code, the server in the code optimization system receives the code optimization request for the object code uploaded by the user terminal, the server generates a first syntax tree according to a structural relationship between at least two code roles included in the object code and matches the first syntax tree with a preset syntax tree in the design pattern library, determines a second syntax tree having a higher matching degree with the first syntax tree than the preset matching degree, a corresponding design pattern in the second syntax tree is an observer pattern and the observer pattern is a design pattern to be optimized, and the server follows a mapping relationship between a standard design pattern and the design pattern to be optimized, and determining that the corresponding standard design mode is the observer mode when the design mode to be optimized is the polling mode, so that the server optimizes the polling mode of the target code according to the design mode of the observer mode, obtains the optimized target code and sends the optimized target code to the user terminal.
It can be seen that, in the embodiment of the present application, a first syntax tree is generated according to a structural relationship between at least two code roles included in a target code, the first syntax tree is matched with a preset syntax tree in a design pattern library, a second syntax tree with a matching degree higher than the preset matching degree with the first syntax tree is determined, when a second design pattern in the second syntax tree is a design pattern to be optimized, a first standard design pattern is determined according to a mapping relationship between the standard design pattern and the design pattern to be optimized, and the first design pattern of the target code is optimized according to the first standard design pattern. By adopting the method of the embodiment of the application, when the design mode corresponding to the syntax tree of the target code is the design mode to be optimized, the first design mode of the target code is optimized according to the first standard design mode, so that the code design mode of the optimized target code is the standard design mode, the workload of a developer in the subsequent link of the compiling process for reading or debugging the code program is further reduced, and the developer is effectively helped to carry out code quality management work.
In one possible example, the method further includes:
determining whether the design mode to be optimized and the reference design mode have the same realization function;
if so, analyzing the design mode to be optimized and the reference design mode, and respectively determining the code performance of the design mode to be optimized and the reference design mode when the same realization function is realized;
and if the code performance of the reference design mode is superior to that of the design mode to be optimized when the same realization function is realized, determining the reference design mode as a standard design mode having a corresponding mapping relation with the design mode to be optimized.
Illustratively, the design mode to be optimized is a polling mode, the reference design mode is an observer mode, and it is determined that both the polling mode and the observer mode can observe that a certain target role has a state change, that is, the polling mode and the observer mode have the same implementation function, so that analyzing the code performance of the polling mode and the observer mode when observing the certain target role obtains: when observing the target role, the polling mode polls the state change of the target role according to certain interval time, and does not send out a notice until the polling is completed when the state change occurs; the observer mode can notify a target character when observing the target character as long as the target character changes its state. It can be seen that the response speed of the observer mode is faster than that of the polling mode when the above function is implemented, that is, the code performance of the observer mode is better than that of the polling mode when the above function is implemented, and therefore, the observer mode is determined to be a standard design mode having a corresponding mapping relationship with the polling mode.
It can be seen that, in the embodiment of the present application, if the code performance of the reference design mode is better than that of the design mode to be optimized when the reference design mode implements the same implementation function, the reference design mode is determined to be a standard design mode having a corresponding mapping relationship with the design mode to be optimized, so that the mapping relationship between the obtained standard design mode and the design mode to be optimized can ensure that the code performance of the standard design mode implements the same implementation function is better than that of the design mode to be optimized, and further ensure that the code performance of the optimized target code can be improved.
In one possible example, the determining the first standard design mode according to the mapping relationship between the standard design mode and the design mode to be optimized includes:
if the first standard design mode which has a mapping relation with the design mode to be optimized is a plurality of standard design modes, determining a second standard design mode according to the matching degree of the expected code performance and the code performance corresponding to each standard design mode in the plurality of standard design modes, wherein the second standard design mode is one of the plurality of standard design modes corresponding to the first standard design mode;
the first design mode for optimizing the object code according to the first standard design mode includes:
the first design pattern of the object code is optimized according to a second standard design pattern.
The expected code performance may be code performance such as fast response speed, good expansibility, low coupling degree between code roles, and the like in specific implementation, and is specifically determined according to project requirements of developers.
In a specific implementation, the second standard design pattern may be determined according to a code performance matching degree between the expected code performance and each of the plurality of standard design patterns, and when the code performance matching degree corresponding to the standard design pattern is higher than a certain matching degree, the standard design pattern may be determined to be the second standard design pattern.
Illustratively, the standard design mode having a mapping relation with the design mode 1 to be optimized includes a standard design mode 1 and a standard design mode 2, where the code performance 1 corresponding to the standard design mode 1 is fast in response speed, the code performance 2 corresponding to the standard design mode 2 is good in expansibility, and the code performance expected by the code optimization request for the target code uploaded by the user terminal is fast in response speed, that is, the matching degree of the expected code performance and the code performance corresponding to the standard design mode 1 is higher than the matching degree of the code performance corresponding to the standard design mode 2, so that the standard design mode 1 is determined to be the second standard design mode, and the first design mode of the target code is optimized according to the standard design mode 1.
It can be seen that, in the embodiment of the present application, when the first standard design mode having a mapping relationship with the design mode to be optimized is a plurality of standard design modes, a second standard design mode is determined according to the code performance matching degree of the code performance expected by the code optimization request and corresponding to each standard design mode, and the first design mode of the target code is optimized according to the second standard design mode, so that one standard design mode with the code performance meeting the user expectation is determined in the plurality of standard design modes, and the code performance also meets the code performance expected by the user while the design mode of the target code is optimized to be the standard design mode.
In a possible example, the matching the first syntax tree with a preset syntax tree in the design pattern library and determining the second syntax tree with a matching degree higher than the preset matching degree with the first syntax tree specifically include:
acquiring a highest node and a lowest node of the first syntax tree, wherein the highest node is the node processed firstly when a code of the first syntax tree runs;
matching the highest node and the lowest node of the first syntax tree with a preset syntax tree to determine the first preset syntax tree, wherein the highest node of the first preset syntax tree is the same as the highest node of the first syntax tree, and the lowest node of the first preset syntax tree is the same as the lowest node of the first syntax tree;
and if the matching degree of the first syntax tree and the first preset syntax tree is higher than the preset matching degree, determining the first preset syntax tree as a second syntax tree.
Illustratively, referring to fig. 5, fig. 5 is a schematic diagram of a code optimization method based on a design pattern according to an embodiment of the present application, and as shown in fig. 5, the first syntax tree is the same as the highest-level node of the preset syntax tree and is all "+", and the first syntax tree is the same as the lowest-level node of the preset syntax tree and is all "4" and "5", so that the preset syntax tree is determined to be the first preset syntax tree. Meanwhile, because the nodes on the upper layer of the lowest- layer nodes 4 and 5 are divided, the matching degree of the first syntax tree and the first preset syntax tree is higher than the preset matching degree, the first preset syntax tree is determined to be the second syntax tree, so that the determination of the second syntax tree is completed, and then if the second design mode is the design mode to be optimized, the first standard design mode is determined according to the mapping relation between the standard design mode and the design mode to be optimized, and the first design mode of the target code is optimized according to the first standard design mode.
It can be seen that, in the embodiment of the present application, when the first syntax tree is matched with the preset syntax trees in the design pattern library, the first preset syntax tree that is the same as the highest node and the lowest node of the first syntax tree is determined, and when the matching degree of the first syntax tree and the first preset syntax tree is higher than the preset matching degree, the first preset syntax tree is determined as the second syntax tree. Therefore, when the first syntax tree corresponding to the target code is not a subtree of the preset syntax tree, the second syntax tree which is substantially the same as the first syntax tree can be determined by combining the nodes at the highest layer and the nodes at the lowest layer, the standard design mode corresponding to the design mode of the first syntax tree of the target code is further accurately determined, and the accuracy in determining the design mode of the target code is improved by improving the matching accuracy of the syntax trees.
In a possible example, the matching the first syntax tree with a preset syntax tree in the design pattern library and determining the second syntax tree with a higher matching degree with the first syntax tree than the preset matching degree specifically include:
determining a second preset syntax tree and at least one other node according to the first syntax tree, wherein the second preset syntax tree is a preset syntax tree included in the first syntax tree, and the at least one other node is a node except the second preset syntax tree in the first syntax tree;
acquiring the node type of each other node in at least one other node, wherein the node type comprises a parameter node and a variable node;
determining the matching degree between the first syntax tree and the second preset syntax tree according to the matching degree reduction value between the first syntax tree and the second preset syntax tree by at least one other node, wherein the matching degree reduction value of each parameter node is larger than the matching degree reduction value of each variable node value;
and if the matching degree between the first syntax tree and the second preset syntax tree is higher than the preset matching degree, determining the second preset syntax tree as the second syntax tree.
In one possible example, after obtaining the node type of each of the at least one other node, the method further comprises:
acquiring the node position of each other node in at least one other node;
determining the matching weight of each other node according to the node position of each other node;
before determining the degree of matching between the first syntax tree and the second preset syntax tree based on the reduction of the degree of matching between the first syntax tree and the second preset syntax tree by the at least one other node, the method further comprises:
and determining the matching degree reduction value of at least one other node according to the matching weight value and the matching degree reduction value of each other node in at least one other node.
The parameter node refers to a node corresponding to a calling method or function operation logic defining a certain section of code; variable nodes refer to nodes in a piece of code that refer to the role of the code.
Illustratively, "public static void", "else if", "add" in the target code are parameter nodes in the first syntax tree; and the specific topic "Concrete Subject", the specific Observer "Concrete Observer" is a variable node in the first syntax tree.
In a specific implementation, the matching weight of each other node is determined according to the node position of each other node, and may be determined according to the distance between each other node and the highest-level node in the first syntax tree, for example, the longer the distance from the highest-level node in the first syntax tree is, the smaller the matching weight of the other node is.
For example, if the number of the at least one other node is N, the matching degree reduction value of the at least one other node is equal to the matching degree reduction value of the other node 1 + the matching degree reduction value of the other node 2 + … …, the matching degree reduction value of the other node N is equal to the node type reduction value of the other node 1 + the matching weight value of the other node 1 + the node type reduction value of the other node 2 + … … the node type reduction value of the other node N + the matching weight value of the other node N.
For example, referring to fig. 6, fig. 6 is a schematic diagram of a code optimization method based on a design pattern according to an embodiment of the present application, as shown in fig. 6, assuming "+" - "" + "as a parameter node and" 1 "-" 7 "as a variable node in a first syntax tree, the" - "+" "6" "" 7 "in the first syntax tree except for a second preset syntax tree is 4 other nodes, and then a matching degree reduction value between the first syntax tree and the second preset syntax tree can be determined by the 4 other nodes according to a node type reduction value and a matching weight of each other node in the 4 other nodes.
It can be seen that, in the embodiment of the present application, in the case where the second preset syntax tree and at least one other node are included in the first syntax tree, obtaining a node type and a node location for each of at least one other node, determining a node matching degree reduction value according to the node type of each other node, determining a matching weight value according to the node position, thereby determining a match-score cutback value for at least one other node based on the match weight and the match-score cutback value for each other node, and further determining a matching degree between the first syntax tree and a second preset syntax tree according to the matching degree reduction value of at least one other node, the standard design pattern corresponding to the design pattern of the first syntax tree of the object code can be accurately determined even when the first syntax tree includes other nodes, by improving the accuracy of syntax tree matching, the accuracy in determining the design pattern of the target code is improved.
In one possible example, after determining the second syntax tree having a higher degree of matching with the first syntax tree than a preset degree of matching, the method further includes:
if the first syntax tree comprises a plurality of second syntax trees, acquiring the hierarchical position of the highest-level node of each second syntax tree in the plurality of second syntax trees in the first syntax tree;
sequencing the hierarchical position of the highest level node of each second syntax tree in the first syntax tree from high to low, and determining the corresponding second syntax tree of which the hierarchical position of the highest level node in the first syntax tree is the lowest hierarchical position as a third syntax tree;
if the second design mode in the second syntax tree is the design mode to be optimized, determining the first standard design mode according to the mapping relationship between the standard design mode and the design mode to be optimized, including:
and if the third design mode in the third syntax tree is the design mode to be optimized, determining the first standard design mode according to the mapping relation between the standard design mode and the design mode to be optimized.
It is determined that the second syntax tree 1, the second syntax tree 2 and the second syntax tree 3 are all matched with the first syntax tree with a higher degree of matching than a preset degree of matching, for example, see fig. 7, FIG. 7 is a schematic diagram of a code optimization method based on design patterns according to an embodiment of the present application, as shown in fig. 7, the hierarchical positions of the nodes at the highest level of the second syntax trees 1-3 in the first syntax tree are ordered from high to low, the hierarchical position of the node at the highest level of the second syntax tree 3 in the first syntax tree is the lowest hierarchical position, the second syntax tree 3 is located at the lowest layer of the operation logic of the target code, the design mode corresponding to the second syntax tree 3 is the core design mode of the target code, and therefore, the second syntax tree 3 is determined as the third syntax tree, and when the third design mode in the third syntax tree is the design mode to be optimized, determining the first standard design mode according to the mapping relation between the standard design mode and the design mode to be optimized.
It can be seen that, in the embodiment of the present application, if it is determined that there are a plurality of second syntax trees having a matching degree higher than a preset matching degree with the first syntax tree, the corresponding second syntax tree having the lowest hierarchical position of the highest-level node in the first syntax tree is determined as a third syntax tree, and the first standard design mode is determined according to a mapping relationship between the standard design mode and the design mode to be optimized when the third design mode in the third syntax tree is the design mode to be optimized. Therefore, when the target code possibly corresponds to a plurality of design modes, the design mode corresponding to the lowest operation logic in the target code is determined as the design mode, and one syntax tree which is most matched with the first syntax tree is accurately determined in the second syntax trees, so that the design mode of the target code can be optimized to meet the expected standard design mode.
In one possible example, before generating the first syntax tree based on a structural relationship between at least two code roles, the method further comprises:
determining a role meaning for each of at least two code roles;
determining the target role name of each code role according to the mapping relation between the role meaning and the role name;
modifying the initial name corresponding to each code role into a target role name according to the target role name of each code role;
the generating a first syntax tree according to the structural relationship between at least two code roles includes:
and generating a first syntax tree according to the structural relation of at least one target role name.
For example, in a specific implementation, the mapping relationship between the role meaning and the role name may be established according to a code role corresponding to each of a plurality of design modes, for example, when the design mode is an Observer mode, variable names whose role meaning is "specific Observer" are all mapped to "consumer Observer", and variable names whose role meaning is "specific Subject" are all mapped to "consumer object".
Illustratively, according to the mapping relationship between the role meaning and the role name, determining the target role name of each code role, based on the above exemplary embodiment, if a plurality of code role variable names with the role meaning of "specific topic" such as "the me", "main topic", "motif", etc. are included in different target codes of different user terminals, the code role variable name with the role meaning of "specific topic" will be uniformly modified to "Concrete topic", so that the variable names representing the role meaning of "specific topic" in the above different target codes are all represented as "Concrete topic" in the respectively generated first syntax trees.
It can be seen that, in the embodiment of the present application, before the first syntax tree is generated, the initial name corresponding to each code role is modified into the target role name, and then the first syntax tree is generated according to the structural relationship of at least one target role name. The names corresponding to the code roles are modified in a unified mode, and the variable names with the same role meanings are normalized, so that the bad situation that different developers adopt different role names when naming the variable names with the same role meanings, the first syntax tree is difficult to match with the preset syntax tree in the design pattern library is avoided, and the problem that the code styles are uneven due to the fact that the developers are numerous is also avoided.
Referring to fig. 8, in accordance with the embodiment shown in fig. 3, fig. 8 is a structural diagram of a code optimization apparatus based on a design pattern according to an embodiment of the present application, as shown in fig. 8:
an apparatus for code optimization based on design patterns, said apparatus comprising:
201: the code optimization method comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a code optimization request which is uploaded by a user terminal and aims at a target code, the target code comprises at least two first design modes defined by code roles, and the code optimization request is used for requesting to optimize the first design modes.
202: and the matching unit is used for generating a first syntax tree according to the structural relationship between at least two code roles, matching the first syntax tree with a preset syntax tree in a design pattern library, and determining a second syntax tree with the matching degree higher than the preset matching degree with the first syntax tree, wherein the preset syntax tree comprises a plurality of preset design patterns to be optimized.
203: and the determining unit is used for determining the first standard design mode according to the mapping relation between the standard design mode and the design mode to be optimized if the second design mode in the second syntax tree is the design mode to be optimized.
204: an optimization unit for optimizing a first design pattern of the object code according to a first standard design pattern.
It can be seen that, in the apparatus provided in the embodiment of the present application, a first syntax tree is generated according to a structural relationship between at least two code roles included in an object code, the first syntax tree is matched with a preset syntax tree in a design pattern library, a second syntax tree with a matching degree higher than a preset matching degree with the first syntax tree is determined, when a second design pattern in the second syntax tree is a design pattern to be optimized, a first standard design pattern is determined according to a mapping relationship between a standard design pattern and the design pattern to be optimized, and the first design pattern of the object code is optimized according to the first standard design pattern. By adopting the device provided by the embodiment of the application, when the design mode corresponding to the syntax tree of the target code is the design mode to be optimized, the first design mode of the target code is optimized according to the first standard design mode, so that the code design mode of the optimized target code is the standard design mode, the workload of a developer in the subsequent link of the compiling process for reading or debugging the code program is further reduced, and the developer is effectively helped to carry out code quality management work.
Specifically, the code optimization apparatus based on the design pattern may be divided into functional units according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
In accordance with the embodiment shown in fig. 3, an electronic device is provided in an embodiment of the present application, please refer to fig. 9, fig. 9 is a schematic diagram illustrating a server structure of a hardware operating environment of an electronic device provided in an embodiment of the present application, and as shown in fig. 9, the electronic device includes a processor, a memory, and computer-executable instructions stored in the memory and executable on the processor, and when the computer-executable instructions are executed, the electronic device executes the instructions including the steps of any one of the design-mode-based code optimization methods.
Wherein, the processor is a CPU (Central Processing Unit).
The memory may be a high-speed RAM memory, or may be a stable memory, such as a disk memory.
Those skilled in the art will appreciate that the configuration of the server shown in fig. 9 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in FIG. 9, the memory may include computer-executable instructions for an operating system, a network communication module, and a code optimization method based on design patterns. The operating system is used for managing and controlling hardware and software resources of the server and supporting the running of computer execution instructions. The network communication module is used for realizing communication between each component in the memory and communication with other hardware and software in the server, and the communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), etc.
In the server shown in fig. 9, the processor is configured to execute computer-executable instructions for personnel management stored in the memory, and to implement the following steps: receiving a code optimization request which is uploaded by a user terminal and aims at a target code, wherein the target code comprises a first design mode defined by at least two code roles, and the code optimization request is used for requesting to optimize the first design mode; generating a first syntax tree according to the structural relationship between at least two code roles, matching the first syntax tree with a preset syntax tree in a design pattern library, and determining a second syntax tree with the matching degree higher than the preset matching degree with the first syntax tree, wherein the preset syntax tree comprises a plurality of preset design patterns to be optimized; if the second design mode in the second syntax tree is the design mode to be optimized, determining a first standard design mode according to the mapping relation between the standard design mode and the design mode to be optimized; a first design pattern of the object code is optimized according to a first standard design pattern.
For specific implementation of the server related to the present application, reference may be made to the embodiments of the code optimization method based on the design pattern, which are not described herein again.
An embodiment of the present application provides a computer-readable storage medium, in which computer instructions are stored, and when the computer instructions are executed on a communication apparatus, the communication apparatus is caused to perform the following steps: receiving a code optimization request which is uploaded by a user terminal and aims at a target code, wherein the target code comprises a first design mode defined by at least two code roles, and the code optimization request is used for requesting to optimize the first design mode; generating a first syntax tree according to the structural relationship between at least two code roles, matching the first syntax tree with a preset syntax tree in a design pattern library, and determining a second syntax tree with the matching degree higher than the preset matching degree with the first syntax tree, wherein the preset syntax tree comprises a plurality of preset design patterns to be optimized; if the second design mode in the second syntax tree is the design mode to be optimized, determining a first standard design mode according to the mapping relation between the standard design mode and the design mode to be optimized; a first design pattern of the object code is optimized in accordance with a first standard design pattern. The computer includes an electronic device.
The electronic terminal equipment comprises a mobile phone, a tablet computer, a personal digital assistant, wearable equipment and the like.
The computer-readable storage medium may be an internal storage unit of the electronic device described in the above embodiments, for example, a hard disk or a memory of the electronic device. The computer readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the electronic device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the electronic device. Computer-readable storage media are used to store computer-executable instructions and data as well as other computer-executable instructions and data needed by electronic devices. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
For specific implementation of the computer-readable storage medium related to the present application, reference may be made to the embodiments of the code optimization method based on the design pattern, which are not described herein again.
Embodiments of the present application provide a computer program product, wherein the computer program product comprises a computer program operable to cause a computer to perform some or all of the steps of any one of the design pattern based code optimization methods as described in the above method embodiments, and the computer program product may be a software installation package.
It should be noted that, for simplicity of description, any one of the above embodiments of the code optimization method based on design mode is described as a series of action combinations, but those skilled in the art should understand that the present application is not limited by the described action sequence, because some steps can be performed in other sequences or simultaneously according to the present application. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
The above embodiments of the present application are described in detail, and the principles and embodiments of a code optimization method based on a design pattern and related devices of the present application are described herein with specific examples, and the description of the above embodiments is only used to help understand the method and the core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the code optimization method based on design mode and the related apparatus of the present application, the specific implementation and the application scope may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present application.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, hardware products and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the present application has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed application, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
It is apparent that those skilled in the art can make various changes and modifications to a code optimization method based on design patterns and related devices provided in the present application without departing from the spirit and scope of the present application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for code optimization based on design patterns, the method comprising:
receiving a code optimization request which is uploaded by a user terminal and aims at a target code, wherein the target code comprises a first design mode defined by at least two code roles, and the code optimization request is used for requesting to optimize the first design mode;
generating a first syntax tree according to the structural relationship between at least two code roles, matching the first syntax tree with a preset syntax tree in a design pattern library, and determining a second syntax tree with the matching degree higher than the preset matching degree with the first syntax tree, wherein the preset syntax tree comprises a plurality of preset design patterns to be optimized;
if the second design mode in the second syntax tree is the design mode to be optimized, determining a first standard design mode according to a mapping relation between the standard design mode and the design mode to be optimized;
optimizing a first design pattern of the object code according to the first standard design pattern.
2. The method of claim 1, further comprising:
determining whether the design mode to be optimized and the reference design mode have the same realization function;
if so, analyzing the design mode to be optimized and the reference design mode, and respectively determining the code performance of the design mode to be optimized and the reference design mode when the same realization function is realized;
and if the code performance of the reference design mode is better than that of the design mode to be optimized when the same implementation function is realized, determining the reference design mode as a standard design mode having a corresponding mapping relation with the design mode to be optimized.
3. The method according to claim 1 or 2, wherein the standard design pattern further includes a corresponding code performance, the code optimization request further includes a desired code performance, and the determining a first standard design pattern according to a mapping relationship between the standard design pattern and the design pattern to be optimized includes:
if the first standard design mode which has a mapping relation with the design mode to be optimized is a plurality of standard design modes, determining a second standard design mode according to the expected code performance and the code performance matching degree corresponding to each standard design mode in the plurality of standard design modes, wherein the second standard design mode is one of the plurality of standard design modes corresponding to the first standard design mode;
the first design mode for optimizing the object code according to the first standard design mode comprises the following steps:
and optimizing the first design mode of the target code according to the second standard design mode.
4. The method according to claim 1, wherein the matching the first syntax tree with a preset syntax tree in a design pattern library, and determining a second syntax tree with a higher degree of matching with the first syntax tree than the preset degree of matching are specifically:
acquiring a highest node and a lowest node of the first syntax tree, wherein the highest node is a node processed firstly when a code of the first syntax tree runs;
matching the highest node and the lowest node of the first syntax tree with the preset syntax tree to determine a first preset syntax tree, wherein the highest node of the first preset syntax tree is the same as the highest node of the first syntax tree, and the lowest node of the first preset syntax tree is the same as the lowest node of the first syntax tree;
and if the matching degree of the first syntax tree and the first preset syntax tree is higher than the preset matching degree, determining the first preset syntax tree as the second syntax tree.
5. The method according to claim 1, wherein the matching the first syntax tree with a preset syntax tree in a design pattern library, and determining a second syntax tree with a higher degree of matching with the first syntax tree than the preset degree of matching are specifically:
determining a second preset syntax tree and at least one other node according to the first syntax tree, wherein the second preset syntax tree is the preset syntax tree included in the first syntax tree, and the at least one other node is a node except the second preset syntax tree in the first syntax tree;
obtaining a node type of each other node in at least one other node, wherein the node type comprises a parameter node and a variable node;
determining a matching degree between the first syntax tree and the second preset syntax tree according to a matching degree reduction value between the first syntax tree and the second preset syntax tree by at least one other node, wherein the matching degree reduction value of each parameter node is greater than the matching degree reduction value of each variable node value;
and if the matching degree between the first syntax tree and the second preset syntax tree is higher than the preset matching degree, determining the second preset syntax tree as the second syntax tree.
6. The method of claim 5, wherein after obtaining the node type of each of the at least one other node, the method further comprises:
obtaining a node position of each of the at least one other node;
determining the matching weight of each other node according to the node position of each other node;
before the determining the degree of matching between the first syntax tree and the second preset syntax tree according to the degree of matching reduction value between the first syntax tree and the second preset syntax tree by at least one of the other nodes, the method further comprises:
and determining the matching degree reduction value of at least one other node according to the matching weight value and the matching degree reduction value of each other node in at least one other node.
7. The method of claim 1, wherein after determining a second syntax tree having a higher degree of matching with the first syntax tree than a preset degree of matching, the method further comprises:
if the first syntax tree comprises a plurality of second syntax trees, acquiring the hierarchical position of the highest-level node of each second syntax tree in the plurality of second syntax trees in the first syntax tree;
ranking the hierarchical position of the highest-level node of each second syntax tree in the first syntax tree from high to low, and determining the second syntax tree corresponding to the hierarchical position of the highest-level node in the first syntax tree as the lowest hierarchical position as a third syntax tree;
if the second design mode in the second syntax tree is the design mode to be optimized, determining a first standard design mode according to a mapping relationship between a standard design mode and the design mode to be optimized, including:
and if the third design mode in the third syntax tree is the design mode to be optimized, determining a first standard design mode according to the mapping relation between the standard design mode and the design mode to be optimized.
8. The method of claim 1, wherein prior to the generating a first syntax tree based on structural relationships between at least two of the code roles, the method further comprises:
determining a role meaning for each of at least two of the code roles;
determining the target role name of each code role according to the mapping relation between the role meaning and the role name;
modifying the initial name corresponding to each code role into the target role name according to the target role name of each code role;
the generating a first syntax tree according to a structural relationship between at least two code roles includes:
and generating a first syntax tree according to the structural relation of at least one target role name.
9. An apparatus for design pattern based code optimization, the apparatus comprising:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a code optimization request which is uploaded by a user terminal and aims at a target code, the target code comprises a first design mode defined by at least two code roles, and the code optimization request is used for requesting to optimize the first design mode;
the matching unit is used for generating a first syntax tree according to the structural relationship between at least two code roles, matching the first syntax tree with a preset syntax tree in a design pattern library, and determining a second syntax tree with the matching degree higher than the preset matching degree with the first syntax tree, wherein the preset syntax tree comprises a plurality of preset design patterns to be optimized;
a determining unit, configured to determine, if a second design pattern in the second syntax tree is the design pattern to be optimized, a first standard design pattern according to a mapping relationship between a standard design pattern and the design pattern to be optimized;
and the optimization unit is used for optimizing the first design mode of the target code according to the first standard design mode.
10. An electronic device comprising a processor, a memory, and computer-executable instructions stored on the memory and executable on the processor, which when executed cause the electronic device to perform the method of any of claims 1-8.
CN202210213501.2A 2022-03-04 2022-03-04 Code optimization method based on design mode and related equipment Pending CN114546410A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210213501.2A CN114546410A (en) 2022-03-04 2022-03-04 Code optimization method based on design mode and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210213501.2A CN114546410A (en) 2022-03-04 2022-03-04 Code optimization method based on design mode and related equipment

Publications (1)

Publication Number Publication Date
CN114546410A true CN114546410A (en) 2022-05-27

Family

ID=81661108

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210213501.2A Pending CN114546410A (en) 2022-03-04 2022-03-04 Code optimization method based on design mode and related equipment

Country Status (1)

Country Link
CN (1) CN114546410A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230394021A1 (en) * 2022-06-07 2023-12-07 Oracle International Corporation Computing similarity of tree data structures using metric functions defined on sets

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230394021A1 (en) * 2022-06-07 2023-12-07 Oracle International Corporation Computing similarity of tree data structures using metric functions defined on sets

Similar Documents

Publication Publication Date Title
US8954453B2 (en) On-demand database service system and method for determining whether a developed application will operate properly with at least one other application
US10481884B2 (en) Systems and methods for dynamically replacing code objects for code pushdown
CN112650533B (en) Interface document generation method and device and terminal equipment
CN115617327A (en) Low code page building system, method and computer readable storage medium
CN111124906A (en) Tracking method, compiling method and device based on dynamic embedded points and electronic equipment
WO2020015191A1 (en) Business rule releasing and managing method, electronic device and readable storage medium
CN104679500B (en) Method and device for realizing automatic generation of entity class
CN114546410A (en) Code optimization method based on design mode and related equipment
WO2024002302A1 (en) Application management method, application subscription method, and related device
CN112597023A (en) Case management method and device based on guide picture, computer equipment and storage medium
CN110045983B (en) Version library management method and device and server
CN111885184A (en) Method and device for processing hot spot access keywords in high concurrency scene
CN113495723B (en) Method, device and storage medium for calling functional component
CN113791809B (en) Application exception handling method and device and computer readable storage medium
CN112363700A (en) Cooperative creation method and device of intelligent contract, computer equipment and storage medium
KR100545348B1 (en) An integrated development system for a SyncML server application development
CN109271182B (en) Method and device for upgrading search engine
CN113806327A (en) Database design method and device and related equipment
CN113032004A (en) Method, apparatus and program product for managing development jobs in a development environment
CN117008890B (en) Extended application development system and method
CN115827703B (en) Enumeration data query method and device
CN116450682B (en) Model generation method, device, equipment and medium based on data combination
WO2023155487A1 (en) Code refactoring method and device
CN117407082A (en) Engine configuration method, engine configuration device, electronic equipment and computer storage medium
CN115865898A (en) Method, device, equipment and medium for processing data information among multiple service systems

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