CN111797009B - Method, device and electronic device for detecting code compatibility - Google Patents
Method, device and electronic device for detecting code compatibility Download PDFInfo
- Publication number
- CN111797009B CN111797009B CN202010577194.7A CN202010577194A CN111797009B CN 111797009 B CN111797009 B CN 111797009B CN 202010577194 A CN202010577194 A CN 202010577194A CN 111797009 B CN111797009 B CN 111797009B
- Authority
- CN
- China
- Prior art keywords
- function
- application object
- code
- detected
- target
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3604—Analysis of software for verifying properties of programs
- G06F11/3608—Analysis of software for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention discloses a method, a device and electronic equipment for detecting code compatibility. One embodiment of the method comprises the following steps: acquiring a code to be detected; determining an objective function included in the code to be detected; matching the target function with a first function indicated by pre-acquired information of the first function, wherein the first function is a function supported by a preset application object, and the information of the first function comprises an identifier of the first function and an identifier of the application object supporting the first function; and determining a target application object supporting the code to be detected based on the matching result. The efficiency of compatibility testing of the code to be detected can be improved.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, and an electronic device for detecting code compatibility.
Background
In the process of code development, due to the diversity of the code running environment, the compatibility condition of the code on each application object needs to be judged so as to ensure that the code can be normally executed on each application object. For such detection, it is common to use a real machine/simulator to actually run the code on a low-version platform, and to check in the simulator whether an error occurs, so as to determine the compatibility of the front-end code on each application object.
Disclosure of Invention
This disclosure is provided in part to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The embodiment of the disclosure provides a method, a device and electronic equipment for detecting code compatibility.
In a first aspect, embodiments of the present disclosure provide a method for detecting code compatibility, comprising: acquiring a code to be detected; determining an objective function included in the code to be detected; matching the target function with a first function indicated by pre-acquired information of the first function, wherein the first function is a function supported by a preset application object, and the information of the first function comprises an identifier of the first function and an identifier of the application object supporting the first function; and determining a target application object supporting the code to be detected based on the matching result.
In a second aspect, embodiments of the present disclosure provide an apparatus for detecting code compatibility, comprising: the acquisition unit is used for acquiring the code to be detected; a first determining unit, configured to determine an objective function included in the code to be detected; the matching unit is used for matching the target function with a first function indicated by pre-acquired information of the first function, wherein the first function is a function supported by a preset application object, and the information of the first function comprises an identifier of the first function and an identifier of the application object supporting the first function; and the second determining unit is used for determining a target application object supporting the code to be detected based on the matching result.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method for detecting code compatibility as described in the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for detecting code compatibility as described in the first aspect.
The method, the device and the electronic equipment for detecting the code compatibility provided by the embodiment of the disclosure acquire the code to be detected; determining an objective function included in the code to be detected; matching the target function with a first function indicated by pre-acquired information of the first function, wherein the first function is a function supported by a preset application object, and the information of the first function comprises an identifier of the first function and an identifier of the application object supporting the first function; and determining a target application object supporting the code to be detected based on the matching result. And matching the target function included in the code to be detected with a first function supported by a preset application object, and determining the compatible orientation condition of the code to be detected in the application object according to the matching result. Compared with the prior art, the method and the device have the advantages that the code to be detected needs to be tested on the simulator of the true machine or the application object, the scheme provided by the embodiment does not need to be tested on the simulator of the true machine or the application object, the testing speed of compatibility detection of the code can be improved, and the efficiency of compatibility test of the code to be detected in each application object is higher.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow chart of one embodiment of a method for detecting code compatibility according to the present disclosure;
FIG. 2 is a schematic syntax tree structure diagram;
FIG. 3 is a flow chart of another embodiment of a method for detecting code compatibility according to the present disclosure;
FIG. 4 is a schematic structural diagram of one embodiment of an apparatus for detecting code compatibility according to the present disclosure;
FIG. 5 is an exemplary system architecture in which a method for detecting code compatibility of one embodiment of the present disclosure may be applied;
Fig. 6 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Referring to FIG. 1, a flow of one embodiment of a method for detecting code compatibility according to the present disclosure is shown. The method for detecting code compatibility as shown in fig. 1 includes the steps of:
Step 101, obtaining a code to be detected.
In this embodiment, the code to be detected may be a code to be executed in a preset application object. The application object may be various kinds of application software or application programs.
In some application scenarios, the application object may be a browser.
When the application object is a browser, the code to be detected may be a code to be executed on a browser page. Such as code of a Web application embedded in a browser.
The step of obtaining the code to be detected includes obtaining the code to be detected input by a developer, or obtaining the code to be detected from a specified address according to the specified address input by a user and storing the code to be detected.
The code to be detected may be a code written using JavaScript. But may also be code written in other languages.
JavaScript is a client-side scripting language running in client-side browsers, each browser having a JavaScript parsing engine. The method is a script language, does not need compiling, and can be directly analyzed and executed by a browser.
The JavaScript can enhance the interaction between the user and the html page, control the html elements, enable the page to have some dynamic effects, and enhance the user experience.
Step 102, determining an objective function included in the code to be detected.
After the code to be detected is acquired in step 101, the code to be detected may be analyzed using various methods to determine an objective function included in the code to be detected.
The objective function here may be a plurality of functions included in the code to be detected. When the application object is a browser, the objective function may be a call function triggered by an event. An event-triggered call function refers to a function that can be called in a synchronous or asynchronous manner when a certain event occurs. As an example, the objective function may be a function that invokes a window object, or may be a method call function, a regular match function, or the like.
In some alternative implementations of the present embodiment, the step 102 may include the following steps:
firstly, carrying out grammar analysis on a code to be detected, and determining a grammar tree corresponding to the code to be detected;
And secondly, determining an objective function included in the code to be detected based on the node corresponding to the grammar tree.
Existing parsing tools may be used to parse the code to be detected. Such as esprima, acorn, traceur-compiler.
In these alternative implementations, the code to be detected may be parsed to obtain an abstract syntax tree of the code to be detected. The abstract syntax tree (Abstract Syntax Tree, AST) is a tree structure corresponding to the source code syntax. That is, a source code of a programming language maps statements in the source code onto each node in the tree by building a grammar tree.
Referring to fig. 2, a schematic abstract syntax Tree structure is shown for the statement var ast= "is Tree".
As shown in FIG. 2, the abstract syntax tree has a top level type attribute "Program"201. The second level attribute is "body [ ]"202. The second level of attributes corresponds to an array. Each item stored in the Body array is an object, and all description information of the sentence is contained in the object. "type" VariableDeclaration "203 describes the type of the statement, which is a variable declaration statement. The "kind"204 variable states a key. The content array declared by "declarations [ ]" 205. Each item in the content array is an object. "type" VariableDeclaration "203," kined "204, and" declarations [ ] "205 belong to the third level attribute. "type"206 describes the type of the statement. Belonging to the next level of attribute included in "declarations [ ]" 205. That is, the fourth level attribute of the abstract syntax tree, "id"207 describes the object of the variable name. "init"208 initializes objects of variable values. "id"207 and "init"208 are next-level attributes belonging to "type" 206.
From the above analysis it can be seen that the program code itself can be mapped into a syntax tree. By analyzing each node of the grammar tree, whether each node in the program code corresponds to a sentence or not can be accurately obtained. Such as declaration statements, assignment statements, etc. It is also possible to determine whether each node corresponds to an objective function through a syntax tree.
Specifically, the determining, at the node corresponding to the syntax tree, the objective function included in the code to be detected may include:
traversing each node of the grammar tree, and determining whether each node comprises an objective function based on a preset rule in the traversing process.
The preset rule here may be a coding specification to which the code to be detected complies.
Taking the code to be detected as the code written in JavaScript as an example, the preset rule may be ECMAScript specification. The ECMAScript specification is a scripting programming language standardized by Ecma international (formerly european computer manufacturers association, european Computer Manufacturers Association) through Ecma-262.
Here, the preset specification may include different versions. Different application objects may support different versions.
For each node, the content of the node can be matched with a function supported by a preset specification, and if the matching is successful, the node comprises an objective function.
Step 103, matching the target function with a first function indicated by the pre-acquired information of the first function, wherein the first function is a function supported by a preset application object, and the information of the first function comprises the identification of the first function and the identification of the application object supporting the first function.
The preset application object may include, but is not limited to, office application software, instant messaging application program, browser, etc.
The browser may include, but is not limited to, an IE browser, a Google browser, a fire fox browser, a dog search browser, and a 360 secure browser.
The preset specification supported by the preset application object may be obtained in advance. Further, a plurality of first functions supported by the application object are determined according to the preset specification.
The information of the first function may include an identification of the first function, an identification of an application object supporting the first function.
In practice, the identity of the objective function obtained in step 102 may be matched with the identity of the first function in the information of the first function.
And 104, determining a target application object supporting the code to be detected based on the matching result.
In this embodiment, the target application object may be determined according to the identification of the application object supporting the first function that successfully matches the target function.
In some application scenarios, if the implementation code corresponding to the objective function is the same as the implementation code corresponding to the first function or the same function is implemented, the objective function is considered to be successfully matched with the first function.
In some other application scenarios, if the matching between the identification of the objective function and the identification of the first function in the information of the first function obtained in step 102 is successful, the matching between the objective function and the first function is considered to be successful.
In some optional implementations of this embodiment, the number of objective functions included in the code to be detected may include more than two.
In these alternative implementations, step 103 may include: and matching the objective function included in each code to be detected with the first function indicated by each piece of first function information. Further, the step 104 may include:
and determining the preset application object corresponding to the first function successfully matched with all the target functions as a target application object.
The first function may be a plurality of first functions.
As a schematic illustration, the preset application objects may include an application object a and an application object B. The application object A supports first functions A1 and A2; the application object B supports the first functions A1, B2. The set of functions supported by application objects A and B is { A1, A2, B1, B2}. The objective function may be matched with each first function. The identification of the application object supporting the first function A1 may comprise the identification of the application object a, the identification of the application object B. The identification of the application object supporting the first function A2 may comprise the identification of the application object a. The identification of the application object supporting the first function B1 may comprise the identification of the application object B. The identification of the application object supporting the first function B2 may comprise the identification of the application object B.
If the objective function included in the code to be detected is A1', the objective function A1' may be matched with each first function supported by the preset application object. Taking the successful matching of the objective function A1' and the first function A1 as an example for explanation, the application object supporting the first function A1 can be checked as an application object a and an application object B, so that the objective application object can be determined as the application object a and the application object B.
If the objective functions included in the code to be detected are A1', B1', the objective functions A1', B1' may be respectively matched with the first functions supported by the application object a and the application object B. Taking the example that the objective functions A1', B1' are successfully matched with the first functions A1, B1, respectively, it can be checked that the application object supporting the first function A1 is the application object A, B. The application object supporting the first function B1 is the application object B, so that it can be determined that the target application object is the application object B.
The method for detecting the code compatibility provided by the embodiment obtains the code to be detected; determining an objective function included in the code to be detected; matching the target function with a first function indicated by pre-acquired information of the first function, wherein the first function is a function supported by a preset application object, and the information of the first function comprises an identifier of the first function and an identifier of the application object supporting the first function; and determining a target application object supporting the code to be detected based on the matching result. And matching the target function included in the code to be detected with a first function supported by a preset application object, and determining the compatible orientation condition of the code to be detected in the application object according to the matching result. Compared with the prior art, the method and the device have the advantages that the code to be detected needs to be tested on the simulator of the true machine or the application object, the scheme provided by the embodiment does not need to be tested on the simulator of the true machine or the application object, the testing speed of compatibility detection of the code can be improved, and the efficiency of compatibility test of the code to be detected in each application object is higher.
Referring to fig. 3, a flow chart of another embodiment of a method for detecting code compatibility according to the present disclosure is shown. The method for detecting code compatibility as shown in fig. 3 includes the steps of:
Step 301, a code to be detected is obtained.
In step 302, an objective function included in the code to be detected is determined.
In this embodiment, steps 301 and 302 may be performed in a similar manner to steps 101 and 102 of the embodiment shown in fig. 1, which is not described here.
Step 303, matching the target function with a first function indicated by the pre-acquired information of the first function, where the first function is a function supported by a preset application object, the information of the first function includes an identifier of the first function and an identifier of an application object supporting the first function, and the preset application object includes a first application object.
The process of matching the objective function with the first function in step 303 may refer to the description of step 103 in the embodiment shown in fig. 1, which is not repeated here.
Step 304, if each objective function included in the code to be detected is successfully matched with the first function supported by the first application object, determining the first application object and the second application object corresponding to the first application object as the objective application object.
The second application object is an application object of an updated version of the first application object. In general, the second application object may be a higher version of the application object of the first application object.
Taking a browser as an example, the browser may include multiple versions, e.g., an IE browser may include: internet Explorer8, internet Explorer, internet Explorer, 10, internet Explorer, etc. Internet Explorer8 can be a first application object, internet Explorer, internet Explorer, 10, internet Explorer can each be a second application object. For another example, internet Explorer may be used as the first application object, internet Explorer, internet Explorer11 may be used as the second application object, or the like.
When the code to be detected is detected, a lower version of the browser can be selected to test the code to be detected.
The first application object may be a lower version application object. Typically, a high version of an application object may be compatible with the functionality of a low version of the application object. If the code to be detected can be run on a first application object of a low version, it can theoretically also be run on an application object of a high version.
As an example, browser a, browser C, and browser D are browsers of the same kernel. Browser C is the browser of the updated version of browser a, and browser D is the browser of the updated version of browser C. I.e. the version of browser C is greater than the version of browser a; browser D is larger than the version of browser C. When compatibility test is carried out on the code to be detected, the browser A can be selected as a browser for testing. That is, browser a is taken as the first application object.
In this embodiment, the step 304 may include: and matching the target function included in the code to be detected with each first function supported by the first application object.
A plurality of first functions supported by the first application object may be predetermined. Each objective function of the code to be detected is then matched to the respective first function. If the target functions of the code to be detected are successfully matched with the first function supported by the first application object, it can be determined that the first application object can support the code to be detected. Otherwise, the first application object does not support the code to be detected.
If the first application object is determined to support the code to be detected, the first application object and a second application object corresponding to the first application object can be determined to be target application objects.
The above-described browser a, browser C, and browser D will be described as examples. In the compatibility test of the code to be detected, the browser A is used as a first browser. If it is determined that the browser A supports the code to be detected. Then browser a, browser C, and browser D may be determined to be target browsers.
In some application scenarios, the preset application objects may include application objects of different versions at the same time, and the first function may include a first function included in common by application objects of different versions, and a first function included by application objects of different versions. Each objective function included in the code to be detected may be matched with the above-mentioned first functions. And determining the application object of the lowest version and the application object larger than the lowest version, wherein the application object of the lowest version is successfully matched with the target function included in the code to be detected, as the target application object.
The above-described browser a, browser C, and browser D will be described as examples.
The browser supporting the first functions L1 and L2 can be a browser A, a browser C and a browser D; the browser supporting the first function L3 can be a browser C and a browser D; the browser supporting the first function L4 may be a browser D.
If the target functions included in the code to be tested are successfully matched with the first functions L1, L2 and L3, respectively, the browser C and the browser D can be used as target browsers. Meanwhile, the browser which does not support running the code to be detected can be determined.
In these application scenarios, it is possible to determine, at the same time, a browser that can run the code to be detected, and a browser that does not support running the code to be detected, by one detection. The efficiency of the compatibility test of the code to be detected can be further improved.
Compared with the implementation shown in fig. 1, in this embodiment, the code to be detected is detected by using the application object with a lower version to determine a plurality of schemes supporting the application object of the code to be detected, so that higher efficiency of detecting compatibility of the code to be detected can be obtained.
With further reference to fig. 4, as an implementation of the method shown in the foregoing figures, the present disclosure provides an embodiment of an apparatus for detecting code compatibility, which corresponds to the method embodiment shown in fig. 1, and which is particularly applicable to various electronic devices.
As shown in fig. 4, the apparatus for detecting code compatibility of the present embodiment includes: an acquisition unit 401, a first determination unit 402, a matching unit 403, and a second unit 404. Wherein, the acquiring unit 401 is configured to acquire a code to be detected; a first determining unit 402, configured to determine an objective function included in a code to be detected; a matching unit 403, configured to match the objective function with a first function indicated by pre-acquired information of the first function, where the first function is a function supported by a preset application object, and the information of the first function includes an identifier of the first function and an identifier of the application object supporting the first function; a second determining unit 404, configured to determine, based on the matching result, a target application object supporting the code to be detected.
In this embodiment, the specific processes and the technical effects of the acquiring unit 401, the first determining unit 402, the matching unit 403, and the second unit 404 of the device for detecting code compatibility may refer to the descriptions related to step 101, step 102, step 103, and step 104 in the corresponding embodiment of fig. 1, and are not repeated here.
In some optional implementations of the present embodiment, the first determining unit 401 is further configured to: carrying out grammar analysis on the code to be detected, and determining a grammar tree corresponding to the code to be detected; and determining an objective function included in the code to be detected based on the node corresponding to the grammar tree.
In some optional implementations of the present embodiment, the number of objective functions is more than two, and the matching unit 403 is further configured to: matching each first function with each objective function; and the second determining unit 404 is further configured to: and determining the application object corresponding to the first function successfully matched with all the target functions as the target application object.
In some optional implementations of this embodiment, the preset application object includes a first application object, and the second determining unit 404 is further configured to: if each objective function included in the code to be detected is successfully matched with the first function supported by the first application object, determining the first application object and the second application object corresponding to the first application object as target application objects; wherein the second application object is an application object of an updated version of the first application object.
In some optional implementations of the present embodiment, the first determining unit 402 is further configured to: traversing each node of the grammar tree, and determining whether each node comprises an objective function based on a preset specification in the traversing process.
In some optional implementations of this embodiment, the application object is a browser.
Referring to fig. 5, fig. 5 illustrates an exemplary system architecture in which a method for detecting code compatibility of an embodiment of the present disclosure may be applied.
As shown in fig. 5, the system architecture may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used as a medium to provide communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The terminal devices 501, 502, 503 may interact with the server 505 via the network 504 to receive or send messages or the like. Various client applications, such as a multimedia conference class application, a web browser application, a search class application, etc., may be installed on the terminal devices 501, 502, 503. The client application in the terminal device 501, 502, 503 may receive the instruction of the user and perform the corresponding function according to the instruction of the user, for example, obtain the information for presentation from the server according to the instruction of the user.
The terminal devices 501, 502, 503 may be hardware or software. When the terminal devices 501, 502, 503 are hardware, they may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and desktop computers, and the like. When the terminal devices 501, 502, 503 are software, they can be installed in the above-listed electronic devices. Which may be implemented as multiple software or software modules (e.g., software or software modules for providing distributed services) or as a single software or software module. The present invention is not particularly limited herein.
The server 505 may be a server that provides various services, such as detecting a browser application to be displayed at a terminal device.
It should be noted that the method for detecting code compatibility provided by the embodiments of the present disclosure may be performed by the server 505, and accordingly, the apparatus for detecting code compatibility may be disposed in the server 505. In addition, the method for detecting code compatibility provided by the embodiments of the present disclosure may also be performed by the terminal devices 501, 502, 503, and accordingly, the means for detecting code compatibility may be provided in the terminal devices 501, 502, 503.
It should be understood that the number of terminal devices, networks and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to fig. 6, a schematic diagram of an electronic device (e.g., a server or terminal device in fig. 5) suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 6, the electronic device may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a code to be detected; determining an objective function included in the code to be detected; matching the target function with a first function indicated by pre-acquired information of the first function, wherein the first function is a function supported by a preset application object, and the information of the first function comprises an identifier of the first function and an identifier of the application object supporting the first function; and determining a target application object supporting the code to be detected based on the matching result.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not constitute a limitation of the unit itself in some cases, and for example, the acquisition unit may also be described as "a unit that acquires a code to be detected".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010577194.7A CN111797009B (en) | 2020-06-22 | 2020-06-22 | Method, device and electronic device for detecting code compatibility |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010577194.7A CN111797009B (en) | 2020-06-22 | 2020-06-22 | Method, device and electronic device for detecting code compatibility |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111797009A CN111797009A (en) | 2020-10-20 |
| CN111797009B true CN111797009B (en) | 2024-10-29 |
Family
ID=72803034
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010577194.7A Active CN111797009B (en) | 2020-06-22 | 2020-06-22 | Method, device and electronic device for detecting code compatibility |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111797009B (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112764797B (en) * | 2021-01-06 | 2023-03-21 | 浙江大华技术股份有限公司 | Software compatibility detection method and device, electronic device and storage medium |
| CN115373971A (en) * | 2021-05-20 | 2022-11-22 | 北京字节跳动网络技术有限公司 | Application testing method and device, storage medium and electronic equipment |
| CN113849409B (en) * | 2021-09-28 | 2025-02-14 | 北京字跳网络技术有限公司 | Script detection method, device and electronic device |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103942137A (en) * | 2013-01-23 | 2014-07-23 | 腾讯科技(深圳)有限公司 | Browser compatibility testing method and device |
| CN106201850A (en) * | 2015-04-29 | 2016-12-07 | 阿里巴巴集团控股有限公司 | A kind of compatibility test method and device |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106326091B (en) * | 2015-06-24 | 2020-12-11 | 深圳市腾讯计算机系统有限公司 | Method and system for detecting browser webpage compatibility |
| CN108073508B (en) * | 2016-11-18 | 2021-03-19 | 腾讯科技(深圳)有限公司 | Compatibility detection method and device |
| CN107133165B (en) * | 2017-03-22 | 2020-12-11 | 腾讯科技(深圳)有限公司 | Browser compatibility detection method and device |
| CN109684220A (en) * | 2018-12-26 | 2019-04-26 | 苏州博纳讯动软件有限公司 | A kind of browser compatibility analysis method based on event replay |
| CN111240987B (en) * | 2020-01-16 | 2024-03-08 | 北京奇艺世纪科技有限公司 | Method and device for detecting migration program, electronic equipment and computer readable storage medium |
-
2020
- 2020-06-22 CN CN202010577194.7A patent/CN111797009B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103942137A (en) * | 2013-01-23 | 2014-07-23 | 腾讯科技(深圳)有限公司 | Browser compatibility testing method and device |
| CN106201850A (en) * | 2015-04-29 | 2016-12-07 | 阿里巴巴集团控股有限公司 | A kind of compatibility test method and device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111797009A (en) | 2020-10-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111694757B (en) | Application program testing method and device, electronic equipment and computer readable storage medium | |
| CN111309304B (en) | Method, device, medium and electronic equipment for generating IDL file | |
| CN111506904B (en) | Method and device for online bug repair | |
| CN111858381B (en) | Application fault tolerance capability test method, electronic device and medium | |
| CN113391860B (en) | Service request processing method and device, electronic equipment and computer storage medium | |
| CN111797009B (en) | Method, device and electronic device for detecting code compatibility | |
| CN113835992B (en) | Memory leakage processing method and device, electronic equipment and computer storage medium | |
| CN111539200B (en) | Method, device, medium and electronic equipment for generating rich text | |
| CN110851139A (en) | Method, device and electronic device for checking codes | |
| CN113407165A (en) | SDK generation and self-upgrade method, device, readable medium and equipment | |
| CN112433730B (en) | Code detection rule generation method and device and electronic equipment | |
| CN110780874A (en) | Method and apparatus for generating information | |
| CN111783010B (en) | Webpage blank page monitoring method, device, terminal and storage medium | |
| CN112379967B (en) | Simulator detection method, device, equipment and medium | |
| CN111813685A (en) | Automatic testing method and device | |
| CN112631590B (en) | Component library generation method, device, electronic equipment and computer readable medium | |
| CN112988569B (en) | A microservice request response viewing method and system based on nginx | |
| CN111625422B (en) | Thread monitoring method, thread monitoring device, electronic equipment and computer readable storage medium | |
| CN111338813B (en) | Method, device, medium and electronic equipment for dynamically generating middleware | |
| CN111209205B (en) | Configuration method, apparatus and electronic device | |
| CN114928556B (en) | Interface service testing method and related equipment | |
| CN111752834A (en) | Automated testing method and device | |
| CN112487416A (en) | Business process verification method and device and electronic equipment | |
| CN112559328B (en) | Discrimination method, device, equipment and medium of instruction simulation engine | |
| CN111782549B (en) | Test method, device and electronic equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP03 | Change of name, title or address | ||
| CP03 | Change of name, title or address |
Address after: Room 2, room 3, building No. 3, courtyard 30, Shixing Avenue, Shijingshan District, Beijing, Beijing Patentee after: Douyin Vision Co.,Ltd. Country or region after: China Address before: Room 2, room 3, building No. 3, courtyard 30, Shixing Avenue, Shijingshan District, Beijing, Beijing Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd. Country or region before: China |