CN111897687B - Interface verification method, device, equipment and storage medium - Google Patents
Interface verification method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN111897687B CN111897687B CN202010839963.6A CN202010839963A CN111897687B CN 111897687 B CN111897687 B CN 111897687B CN 202010839963 A CN202010839963 A CN 202010839963A CN 111897687 B CN111897687 B CN 111897687B
- Authority
- CN
- China
- Prior art keywords
- interface
- components
- function
- functional
- recorded
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 238000012795 verification Methods 0.000 title claims abstract description 27
- 230000001419 dependent effect Effects 0.000 claims abstract description 40
- 230000006870 function Effects 0.000 claims description 112
- 230000015654 memory Effects 0.000 claims description 19
- 238000000605 extraction Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 9
- 238000004806 packaging method and process Methods 0.000 claims description 7
- 238000011161 development Methods 0.000 abstract description 12
- 230000008569 process Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012856 packing Methods 0.000 description 3
- 230000007812 deficiency Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 229910002056 binary alloy Inorganic materials 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000012938 design process Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007849 functional defect Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012858 packaging process Methods 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
- G06F11/221—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/362—Software debugging
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The application discloses an interface verification method, device, equipment and storage medium, and relates to the fields of software development, mobile application and webpage development. The implementation scheme is as follows: determining a target application program, wherein the target application program comprises a functional component characterized by a preset code; extracting current interface characteristics provided by the functional component to obtain a first interface list; extracting interface characteristics of other function components which are recorded in preset codes of the function components and depend on the function components; and comparing the interface characteristics of other self-dependent functional components recorded in the extracted preset codes of the functional components with the current interface characteristics in the first interface list to determine whether the functional components with the dependency relationships are compatible, so that whether the functional components with the dependency relationships are compatible is determined, and a foundation can be laid for avoiding application program function errors or function missing caused by incompatibility especially in the program development fields of mobile application, web page development and the like.
Description
Technical Field
The application relates to the field of computers, in particular to the fields of software development, mobile application and webpage development.
Background
With the rapid development of the mobile internet, a mobile terminal application program (App) is not a single function or tool, and gradually develops to an engineering platform, so that the compiled source codes are more and more, the compiling time is longer and the development efficiency is seriously affected. The architecture of the code engineering gradually develops to the direction of code modularization and componentization, all modules are mutually isolated, the engineering is accessed in a binary code mode, the compiling number of the modules during development is reduced, and the development efficiency is improved.
For an App including multiple functional components, each functional component in the App is represented by a binary code, where one functional component may call multiple other components that it depends on, at this time, how to verify whether the functional components represented by the binary code with dependency relationships are compatible, so as to avoid a problem that a functional error or a functional loss is caused by incompatibility is currently needed to be solved.
Disclosure of Invention
The application provides an interface verification method, device, equipment and storage medium.
According to an aspect of the present application, there is provided an interface verification method, including:
determining a target application program, wherein the target application program comprises a functional component characterized by a preset code;
extracting current interface characteristics provided by the functional components to obtain a first interface list, wherein the first interface list comprises the current interface characteristics of each functional component in the target application program;
extracting interface characteristics of other function components which are recorded in preset codes of the function components and depend on the function components;
and comparing the extracted interface characteristics of other function components which are recorded in the preset codes of the function components and are dependent on the function components with the current interface characteristics in the first interface list to determine whether the function components with the dependency relationship are compatible.
According to another aspect of the present application, there is provided an interface verification apparatus, including:
the program determining unit is used for determining a target application program, wherein the target application program comprises a functional component characterized by a preset code;
the first interface feature extraction unit is used for extracting current interface features provided by the functional components to obtain a first interface list, wherein the first interface list comprises the current interface features of the functional components in the target application program;
the second interface feature extraction unit is used for extracting interface features of other self-dependent functional components recorded in the preset codes of the functional components;
And the interface comparison unit is used for comparing the interface characteristics of other self-dependent functional components recorded in the extracted preset codes of the functional components with the current interface characteristics in the first interface list to determine whether the functional components with the dependency relationship are compatible.
According to another aspect of the present application, there is provided an electronic apparatus including:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method described above.
According to another aspect of the present application there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method described above.
According to another aspect of the application, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method as described above.
The technology provides a scheme for checking whether the function components with the dependency relationship represented by the preset codes are compatible or not, and lays a foundation for effectively avoiding the function errors or the function missing of the application program caused by incompatibility.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
Drawings
The drawings are included to provide a better understanding of the present application and are not to be construed as limiting the application. Wherein:
FIG. 1 is a diagram showing the comparison of interface features of functional components depending on practical application before and after transformation;
FIG. 2 is a schematic diagram of an interface verification method according to an embodiment of the application;
FIG. 3 is a schematic diagram I of an interface verification method in a specific example according to an embodiment of the application;
FIG. 4 is a diagram II of an interface verification method according to an embodiment of the application in a specific example;
FIG. 5 is a schematic diagram of an interface verification device according to an embodiment of the present application;
fig. 6 is a block diagram of an electronic device for implementing an interface verification method of an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present application are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
At present, in software engineering, such as iOS engineering, there is no method for checking whether a plurality of associated binary modules (i.e. functional components represented by binary codes) are compatible, so that only an application program (at least consisting of a plurality of functional components represented by binary codes) of binary codes can be switched to source codes and packaged and released, so that functional problems caused by incompatibility of binary modules are avoided, but compared with binary modules, the compiling process and packaging efficiency are low.
Specifically, as shown in fig. 1, the functional component a depends on the functional component B and the functional component C, and interface features of the functional component B and the functional component C that depend on, that is, an interface B macro= "origin", and an interface C function (Ingeter) are recorded in the functional component a; however, when the interface features of the functional component B and the functional component C are changed, for example, the interface feature of the functional component B is changed to the interface B macro= "now", and the interface feature of the functional component C is changed to the interface C function (flow), at this time, even if the binary codes published by the functional component B and the functional component C are changed, the dependency relationship recorded in the binary code form in the functional component a may not be changed, and if the functional component a calls the functional component B or the functional component C, a problem such as a functional error or a functional deficiency occurs, so how to verify whether the functional component with the dependency relationship is compatible, and the problem that the functional error or the functional deficiency is needed to be solved at present due to incompatibility is avoided.
Based on this, the present application provides an interface checking method, as shown in fig. 2, where the method includes:
step S201: a target application is determined, the target application including a functional component characterized by a preset code.
Step S202: extracting current interface characteristics provided by the functional components to obtain a first interface list, wherein the first interface list comprises the current interface characteristics of each functional component in the target application program. For example, the first interface list includes interface features that are issued by all functional components in the target application program, that is, current interface features.
Step S203: and extracting interface characteristics of other function components which are recorded in the preset codes of the function components and are dependent on the function components.
Step S204: and comparing the extracted interface characteristics of other function components which are recorded in the preset codes of the function components and are dependent on the function components with the current interface characteristics in the first interface list to determine whether the function components with the dependency relationship are compatible.
Therefore, a scheme for checking whether the functional components with the dependency relationship represented by the preset codes (such as binary codes) are compatible is provided, and a foundation is laid for effectively avoiding the functional errors or the functional loss of the application program caused by incompatibility; and further lays a foundation for improving the compiling process and the packing efficiency.
In practical applications, the preset code may be a binary code, a decimal code, or the like. For example, in iOS engineering, the preset code may be specifically a binary code.
Here, the interface feature may refer to a declaration of an interface, and may include, for example, constants (including macros, etc.) or methods (i.e., functions) in the functional component. In practice, binary codes exist in the form of binary files, and accordingly, interface features (i.e., declarations of interfaces) are compiled into byte codes and stored in the binary files.
In practical application, the target application program can be specifically a mobile application program, an application program (such as a browser, a browser plug-in and the like) in the webpage development process and the like, so that the problems of function errors or function missing and the like caused by incompatibility in the program development fields of mobile application, webpage development and the like can be effectively avoided by utilizing the scheme of the application, the development efficiency of mobile application or webpage development is further improved, and meanwhile, a foundation is laid for improving the iteration efficiency of the application program.
In a specific example of the solution of the present application, it may be determined whether the functional components having the dependency relationship are compatible, that is, whether the interface features of the other functional components having the dependency relationship recorded in the extracted preset code of the functional component are traversed, and whether the interface features are present in the first interface list are determined, so as to determine whether the functional components having the dependency relationship are compatible. Therefore, a foundation is laid for effectively avoiding the application program function errors or function missing caused by incompatibility. Moreover, the method is simple and is convenient for engineering popularization and application.
In a specific example of the solution of the present application, the interface features of the other function components that are recorded in the preset code of the function component and that are depended on by themselves and obtained by comparison are all corresponding to the same as the current interface features in the first interface list, that is, when the interface features of the other function components that are depended on by themselves and that are recorded in the preset code of the function component and that are extracted are all present in the first interface list, at this time, compatibility between the interface features of the other function components that are depended on by themselves and that are recorded in the preset code of the function component and the current interface features that are issued by the dependent function component to the outside can be confirmed. Therefore, the problem of application program function errors or function missing caused by incompatibility is effectively solved; and a foundation is laid for accessing the target application program into engineering in a mode of a preset code (such as a binary code), and meanwhile, a foundation is laid for improving compiling efficiency and packaging efficiency.
Here, whether the functional components with the association relationship are compatible or not can be effectively determined, so that problems can be found in time in the compiling process, and a foundation is laid for effectively solving the problems; meanwhile, the problems of functional errors or functional defects and the like of the released App products are avoided, the cost for solving the problems is reduced, and a foundation is laid for improving user experience.
In a specific example of the solution of the present application, after extracting interface features of other function components that are dependent on themselves and recorded in the preset code of the function component, a second interface list is generated, where the second interface list includes interface features of each other function component that is dependent on itself and recorded in the preset code of the function component; at this time, the step 204 includes: and comparing each interface characteristic in the second interface list with each current interface characteristic in the first interface list to determine whether the functional components with the dependency relationship are compatible. Here, the first interface list is a hash table, and the current interface characteristic of the functional component is characterized by a hash value; and/or the second interface list is a hash table, and interface characteristics of other function components which are depended on by the second interface list and recorded in the preset code of the function component are represented by hash values. Therefore, the unique interface characteristics in the interface list, such as the first interface list or the second interface list, are ensured, and a foundation is laid for effectively avoiding the function errors or the function missing of the application program caused by incompatibility. Moreover, the method is simple and is convenient for engineering popularization and application.
In a specific example, comparing each interface feature in the second interface list with each current interface feature in the first interface list to determine whether functional components having a dependency relationship are compatible, including: traversing whether each interface feature in the second interface list exists in the first interface list to determine whether functional components with dependency relationships are compatible. Therefore, a foundation is laid for effectively avoiding the application program function errors or function missing caused by incompatibility. Moreover, the method is simple and is convenient for engineering popularization and application. Here, when it is determined that each interface feature in the second interface list exists in the first interface list after traversing, compatibility between the functional component corresponding to the second interface list and the dependent functional component can be determined. Therefore, the problem of application program function errors or function missing caused by incompatibility is effectively solved; and a foundation is laid for accessing the target application program into engineering in a preset code mode, and meanwhile, a foundation is laid for improving compiling efficiency and packaging efficiency.
Otherwise, traversing to obtain that one or more interface features which are different from the current interface features in the first interface list exist in the second interface list, that is, determining that one or more interface features exist in the second interface list and are not exist in the first interface list after traversing, and at the moment, determining that the functional components corresponding to the second interface list are incompatible with the dependent functional components.
In a specific example, the second interface list corresponds to a specific functional component, where the second interface list is used to store interface features of other functional components that are dependent on itself (i.e. required to be invoked) recorded in the preset code of the specific functional component. Here, a specific functional component is a functional component that exists in any of the target applications to call other functional components. Of course, the second interface list may also record the dependent interface features recorded by all the functional components in the target application. In practical application, the interface characteristics recorded in the specific functional component may be different from the interface characteristics of the functional component which are actually issued to the outside, so that the incompatibility problem exists, and the compatibility problem can be obtained by utilizing the interface verification method of the application to carry out the pre-verification, thereby laying a foundation for avoiding the application program function errors or the function defects caused by the incompatibility.
In a specific example of the present application, the preset code is obtained by converting source codes of the functional components. For example, the preset code is a binary code, and at this time, the binary code is obtained by binary converting the source code of the functional component. That is, the scheme of the application can effectively judge whether the functional components expressed by binary codes are compatible, so that the binary codes can be used in the compiling and packaging processes, and further the compiling efficiency and packaging efficiency are improved.
In a specific example of the scheme of the application, after compatibility among functional components with a dependency relationship is determined, the target application program characterized by a preset code is packaged, and the target application program is issued in a preset code form. For example, after the functional components with the dependency relationship are determined to be compatible, the target application program characterized by the binary code can be directly packaged and released in the form of the binary code. Thus, the compiling efficiency and the packing efficiency are improved.
The following is a further detailed description of the present application with reference to specific examples.
The existing link detection of the compiling linker (LLVM) based on the iOS engineering cannot accurately judge whether binary modules (also called binary components, all refer to functional components represented by binary codes) are compatible, and because interface features of other dependent components recorded by the binary codes corresponding to the functional components, such as constant values, can still detect the dependency relationship after changing, errors cannot be reported, so that the LLVM of the iOS engineering cannot accurately judge whether the binary modules are compatible.
Based on this, an object of the present example is to provide a quick verification scheme, i.e. comparing an interface declaration disclosed by a functional component to an interface declaration recorded in a binary code of the functional component and calling other components, so as to verify whether a plurality of associated functional components are compatible, and avoid a functional error or a functional loss of a published App product. In practical application, the scheme of the application can be applied to the projects of iOS engineering architecture componentization, iOS component binarization, iOS continuous integration and the like.
Specifically, as shown in fig. 3, the present example writes a tool for extracting an abstract syntax tree through LLVM engineering, which can extract method declarations and constants (i.e., interface features) of the functional components exposed to the outside, and method declarations and constants of other components of the required call recorded in the binary code of the functional components. In the process of compiling the functional component into binary code, namely in the process of compiling the functional component (corresponding to the component source code in fig. 3) characterized by the source code into binary code (corresponding to the component binary in fig. 3), an export tool is used to export interfaces of the functional component provided outside and interfaces of other components which are depended on, wherein in the process of compiling the functional component into binary code, at least 3 products are contained, one is the binary code of the functional component, the second is the interface of the functional component provided outside, and the third is the interface of other functional components which the functional component depends on. As shown in fig. 4, before the App product is packaged, the interfaces corresponding to the binary codes of all the functional components in the App are parsed and fused into a hash table (HashMap) which is recorded as an object apis; the interfaces of the functional components depending on other components are also parsed and fused into another HashMap, and recorded as an object invokes, for example, an App contains N functional components (simply called components), where N is greater than or equal to 2; at this time, the interface sets respectively called by the component a, the component B and the component … … and the component N can be fused into HashMap and recorded as apis respectively to obtain N apis; or fusing interface sets respectively called by the component A, the component B and … … and the component N into a HashMap, and recording the HashMap as an apis to obtain an apis; then, traversing invokes sequentially whether all interfaces exist in the apis or not, for example, the interfaces are characterized by hash values, at this time, whether the hash values (also called key values) in invokes match the values in the apis or not can be traversed, whether the types and the values of the quoted interfaces in the interfaces are the same or not is judged, and if the types and the values are different, the interfaces are judged to be incompatible; otherwise, it is determined to be compatible.
The core problems in the design process of the scheme of the application include:
an interface of the first extraction assembly;
In practical application, c/c++/objective-c uses LLVM to compile and link, according to the compiling process of LLVM, there is a grammar analysis process capable of processing all source codes into independent abstract grammar tree, and the related information of declaration and expression of each interface is reserved inside. However, for the macro processed in the preprocessing stage, information extraction can only be performed through the token generated during preprocessing, and the extracted information comprises: declaration name, declaration type, parent class, protocol to follow, method parameter type, method return value, constant type, macro definition value, source code file, source code line location.
Secondly, ensuring that the generated interface is unique;
Because the grammar has the characteristics of polymorphism, inheritance, overwriting and the like, and the same class and method possibly exist in different files, it is very important to ensure that generated interfaces correspond to unique names.
Thirdly, accessing derived interfaces and dependent interfaces;
When the component is released as binary codes by the source codes, the source codes of the component can be exported by utilizing a tool for extracting a grammar tree by using the LLVM, and interface information of other components is exported similarly, and respectively exported to different files for storage, and the binary codes are released into a file server together with the binary codes compiled by the component; when compiling an App package, pulling binary codes and corresponding interfaces of all components defined by the App and interface files of other components called by the components from a file server to a local place, so as to carry out binary module compatibility verification and subsequent compiling and packaging processing.
Fourth, promote the efficiency of contrast;
For componentized iOS engineering, the number of components is typically very large, as are the corresponding interfaces and interfaces called. Analyzing interfaces of all components on which the App depends into one HashMap (such as apis), abstracting interfaces of other components on which the components depend into another HashMap (such as invokes), and searching key values to the apis by taking the called invokes as a reference; here, the time complexity of a single key value lookup is 1, so the total time complexity is count (invokes).
Therefore, a verification process of whether a plurality of associated binary modules are compatible is realized, so that the product can be ensured to be effectively binarized into components, the development debugging efficiency and the version release efficiency can be ensured, the version release safety and stability can be ensured, and the online problem caused by incompatibility of the binary systems can be effectively avoided.
The present application provides an interface checking device, as shown in fig. 5, including:
a program determining unit 501, configured to determine a target application program, where the target application program includes a functional component characterized by a preset code;
A first interface feature extraction unit 502, configured to extract current interface features provided by the functional components to obtain a first interface list, where the first interface list includes current interface features of each functional component in the target application;
A second interface feature extraction unit 503, configured to extract interface features of other function components that are dependent on themselves and recorded in a preset code of the function component;
And an interface comparing unit 504, configured to compare the interface characteristics of the other function components that are dependent on themselves and recorded in the extracted preset code of the function component with each current interface characteristic in the first interface list, so as to determine whether the function components with the dependency relationships are compatible with each other.
In a specific example of the solution of the present application, the interface comparing unit is further configured to:
Traversing the interface characteristics of other function components which are recorded in the extracted preset codes of the function components and are dependent on the function components, and determining whether the interface characteristics exist in the first interface list or not so as to determine whether the function components with the dependent relations are compatible or not.
In a specific example of the solution of the present application, the interface comparing unit is further configured to:
And comparing the interface characteristics of other function components which are recorded in the preset codes of the extracted function components and are dependent on the function components, wherein the interface characteristics are the same as the current interface characteristics in the first interface list, and determining compatibility between the function components and the other function components which are dependent on the function components.
In a specific example of the solution of the present application, the second interface feature extraction unit is further configured to: generating a second interface list after extracting the interface characteristics of other self-dependent functional components recorded in the preset code of the functional component, wherein the second interface list comprises the interface characteristics of all other self-dependent functional components recorded in the preset code of the functional component;
The interface comparison unit is further configured to compare each interface feature in the second interface list with each current interface feature in the first interface list to determine whether functional components with a dependency relationship are compatible with each other; the first interface list is a hash table, and the current interface characteristics of the functional component are represented by hash values; and/or the second interface list is a hash table, and interface characteristics of other function components which are depended on by the second interface list and recorded in the preset code of the function component are represented by hash values.
In a specific example of the present application, the preset code is obtained by converting source codes of the functional components.
In a specific example of the solution of the present application, the method further includes:
And the issuing unit is used for packaging the target application program represented by the preset code after the functional components with the dependency relationship are compatible, and issuing the target application program in the form of the preset code.
According to embodiments of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.
As shown in fig. 6, a block diagram of an electronic device according to an interface verification method according to an embodiment of the present application is shown. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 6, the electronic device includes: one or more processors 601, memory 602, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 601 is illustrated in fig. 6.
The memory 602 is a non-transitory computer readable storage medium provided by the present application. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the interface verification method provided by the present application. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the interface verification method provided by the present application.
The memory 602 is used as a non-transitory computer readable storage medium, and may be used to store a non-transitory software program, a non-transitory computer executable program, and modules, such as program instructions/modules corresponding to the interface verification method in the embodiment of the present application (e.g., the program determining unit 501, the first interface feature extracting unit 502, the second interface feature extracting unit 503, and the interface comparing unit 504 shown in fig. 5). The processor 601 executes various functional applications of the server and data processing by running non-transitory software programs, instructions and modules stored in the memory 602, i.e., implements the interface verification method in the method embodiments described above.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the electronic device of the interface verification method, and the like. In addition, the memory 602 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 602 may optionally include memory remotely located with respect to processor 601, which may be connected to the electronic device of the interface verification method via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the interface verification method may further include: an input device 603 and an output device 604. The processor 601, memory 602, input device 603 and output device 604 may be connected by a bus or otherwise, for example in fig. 6.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device of the interface verification method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, and the like. The output means 604 may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASIC (application specific integrated circuit), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme provided by the embodiment of the application, a scheme for checking whether the function components with the dependency relationship and represented by the preset codes are compatible is provided, and a foundation is laid for effectively avoiding the function errors or the function missing of the application program caused by incompatibility; and further lays a foundation for improving the compiling process and the packing efficiency.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed embodiments are achieved, and are not limited herein.
The above embodiments do not limit the scope of the present application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of the present application.
Claims (13)
1. An interface verification method, comprising:
determining a target application program, wherein the target application program comprises a functional component characterized by a preset code;
extracting current interface characteristics provided by the functional components to obtain a first interface list, wherein the first interface list comprises the current interface characteristics of each functional component in the target application program;
extracting interface characteristics of other function components which are recorded in preset codes of the function components and depend on the function components;
comparing the interface characteristics of other self-dependent functional components recorded in the extracted preset codes of the functional components with the current interface characteristics in the first interface list to determine whether the functional components with the dependency relationship are compatible;
The comparing the interface features of the other function components which are recorded in the preset code of the function component and are dependent on the function component with the current interface features in the first interface list to determine whether the function components with the dependent relationship are compatible or not, including:
Traversing the interface characteristics of other function components which are recorded in the extracted preset codes of the function components and are dependent on the function components, and determining whether the interface characteristics exist in the first interface list or not so as to determine whether the function components with the dependent relations are compatible or not.
2. The method of claim 1, further comprising:
And comparing the interface characteristics of other function components which are recorded in the preset codes of the extracted function components and are dependent on the function components, wherein the interface characteristics are the same as the current interface characteristics in the first interface list, and determining compatibility between the function components and the other function components which are dependent on the function components.
3. The method of claim 1, further comprising, after said extracting interface features of the other function components that are dependent on themselves recorded in the preset code of the function component:
generating a second interface list, wherein the second interface list comprises interface characteristics of each other function component which are recorded in preset codes of the function components and are dependent on the function components;
the comparing the interface characteristics of the other function components which are recorded in the extracted preset code of the function component and depend on the function component with the current interface characteristics in the first interface list comprises the following steps:
Comparing each interface characteristic in the second interface list with each current interface characteristic in the first interface list to determine whether the function components with the dependency relationship are compatible;
the first interface list is a hash table, and the current interface characteristics of the functional component are represented by hash values; and/or the second interface list is a hash table, and interface characteristics of other function components which are depended on by the second interface list and recorded in the preset code of the function component are represented by hash values.
4. The method of claim 1, wherein the preset code is converted from a source code of the functional component.
5. The method of claim 1, further comprising:
After compatibility among the functional components with the dependency relationship is determined, the target application program represented by the preset code is packaged, and the target application program is issued in the form of the preset code.
6. An interface verification apparatus, comprising:
the program determining unit is used for determining a target application program, wherein the target application program comprises a functional component characterized by a preset code;
the first interface feature extraction unit is used for extracting current interface features provided by the functional components to obtain a first interface list, wherein the first interface list comprises the current interface features of the functional components in the target application program;
the second interface feature extraction unit is used for extracting interface features of other self-dependent functional components recorded in the preset codes of the functional components;
The interface comparison unit is used for comparing the interface characteristics of other self-dependent functional components recorded in the extracted preset codes of the functional components with the current interface characteristics in the first interface list to determine whether the functional components with the dependency relationship are compatible;
wherein, the interface comparison unit is further used for:
Traversing the interface characteristics of other function components which are recorded in the extracted preset codes of the function components and are dependent on the function components, and determining whether the interface characteristics exist in the first interface list or not so as to determine whether the function components with the dependent relations are compatible or not.
7. The apparatus of claim 6, the interface comparison unit further to:
And comparing the interface characteristics of other function components which are recorded in the preset codes of the extracted function components and are dependent on the function components, wherein the interface characteristics are the same as the current interface characteristics in the first interface list, and determining compatibility between the function components and the other function components which are dependent on the function components.
8. The apparatus of claim 6, wherein the second interface feature extraction unit is further configured to: generating a second interface list after extracting the interface characteristics of other self-dependent functional components recorded in the preset code of the functional component, wherein the second interface list comprises the interface characteristics of all other self-dependent functional components recorded in the preset code of the functional component;
The interface comparison unit is further configured to compare each interface feature in the second interface list with each current interface feature in the first interface list to determine whether functional components with a dependency relationship are compatible with each other;
the first interface list is a hash table, and the current interface characteristics of the functional component are represented by hash values; and/or the second interface list is a hash table, and interface characteristics of other function components which are depended on by the second interface list and recorded in the preset code of the function component are represented by hash values.
9. The apparatus of claim 6, wherein the preset code is converted from a source code of the functional component.
10. The apparatus of claim 6, further comprising:
And the issuing unit is used for packaging the target application program represented by the preset code after the functional components with the dependency relationship are compatible, and issuing the target application program in the form of the preset code.
11. An electronic device, comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010839963.6A CN111897687B (en) | 2020-08-19 | 2020-08-19 | Interface verification method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010839963.6A CN111897687B (en) | 2020-08-19 | 2020-08-19 | Interface verification method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111897687A CN111897687A (en) | 2020-11-06 |
CN111897687B true CN111897687B (en) | 2024-04-26 |
Family
ID=73229130
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010839963.6A Active CN111897687B (en) | 2020-08-19 | 2020-08-19 | Interface verification method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111897687B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113688045B (en) * | 2021-08-26 | 2024-03-22 | 烽火通信科技股份有限公司 | Automatic checking method and device for binary interface compatibility |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110377471A (en) * | 2019-07-17 | 2019-10-25 | 江苏满运软件科技有限公司 | Generation method, device, storage medium and the electronic equipment of interface check data |
CN111309593A (en) * | 2020-01-16 | 2020-06-19 | 中国平安财产保险股份有限公司 | JSON interface verification method, device and equipment and computer readable storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8572505B2 (en) * | 2011-01-31 | 2013-10-29 | Oracle International Corporation | Automatically testing a web application that has independent display trees |
-
2020
- 2020-08-19 CN CN202010839963.6A patent/CN111897687B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110377471A (en) * | 2019-07-17 | 2019-10-25 | 江苏满运软件科技有限公司 | Generation method, device, storage medium and the electronic equipment of interface check data |
CN111309593A (en) * | 2020-01-16 | 2020-06-19 | 中国平安财产保险股份有限公司 | JSON interface verification method, device and equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111897687A (en) | 2020-11-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111666206B (en) | Method, device, equipment and storage medium for acquiring influence range of change code | |
CN111625224B (en) | Code generation method, device, equipment and storage medium | |
US9430228B2 (en) | Verification of backward compatibility of software components | |
CN108139891B (en) | Method and system for generating suggestions to correct undefined token errors | |
US9122540B2 (en) | Transformation of computer programs and eliminating errors | |
CN111694564B (en) | Method, device, equipment and medium for compiling Flutter mixed mode | |
US9753705B2 (en) | Conditional compilation of bytecode | |
KR20210039358A (en) | Method, apparatus, device and storage medium for processing circular instruction | |
CN111475164B (en) | Component dependency relationship detection method and device and electronic equipment | |
CN111176629A (en) | Application development method and device | |
CN110673837B (en) | Code repairing method and device, electronic equipment and computer readable storage medium | |
US12032941B2 (en) | Method and system for updating legacy software | |
US20140298290A1 (en) | Identification of code changes using language syntax and changeset data | |
CN113282487A (en) | Programming language debugging method and device and terminal equipment | |
CN112463256A (en) | Method, system, electronic device and storage medium for determining configuration file | |
CN111897687B (en) | Interface verification method, device, equipment and storage medium | |
CN112269706A (en) | Interface parameter checking method and device, electronic equipment and computer readable medium | |
CN117520195A (en) | Method, apparatus, device, storage medium and program product for testing interface | |
US20140359258A1 (en) | Declarative Configuration Elements | |
CN111399842A (en) | Code compiling method and device | |
CN111796832B (en) | Hot patch file generation method, device, equipment and storage medium | |
CN107451050A (en) | Function acquisition methods and device, server | |
CN110018816B (en) | Virtual machine control system based on C/C + + compiling system and control method thereof | |
JP2018121245A (en) | Communication apparatus, communication specification difference extraction method, and communication specification difference extraction program | |
CN116069582A (en) | Application program generation method and 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 |