CN107451050B - Function acquisition method and device and server - Google Patents

Function acquisition method and device and server Download PDF

Info

Publication number
CN107451050B
CN107451050B CN201710468198.XA CN201710468198A CN107451050B CN 107451050 B CN107451050 B CN 107451050B CN 201710468198 A CN201710468198 A CN 201710468198A CN 107451050 B CN107451050 B CN 107451050B
Authority
CN
China
Prior art keywords
function
node
service system
function identifier
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710468198.XA
Other languages
Chinese (zh)
Other versions
CN107451050A (en
Inventor
周小建
陈吉
付宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201710468198.XA priority Critical patent/CN107451050B/en
Publication of CN107451050A publication Critical patent/CN107451050A/en
Application granted granted Critical
Publication of CN107451050B publication Critical patent/CN107451050B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the application discloses a function obtaining method and device and a server. The method comprises the following steps: acquiring a function identifier of a function which is changed in a first service system, and using the function identifier as a function identifier in a function identifier set; constructing a node correlation network; wherein the node association network comprises at least one node; each node is a function identification of a function in the second service system; the node association network comprises directed association relations among nodes; acquiring at least one interface node from the node association network based on the function identifier in the function identifier set by using the directed association relation among the nodes; the interface node is a node in the node association network, and the directed association relationship is not pointed to by other nodes.

Description

Function acquisition method and device and server
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for function acquisition, and a server.
Background
In the software life cycle, when a software itself has a change such as code upgrade, version iteration or bug fix, or when other software associated with the software has a change such as code upgrade, version iteration or bug fix, the software generally needs to be tested to ensure that the change does not damage the original function of the software. In the software testing process, a certain number of test cases are generally required to be executed. In view of the problem of low test efficiency caused by executing all test cases, a tester usually needs to analyze the interface functions affected by the above changes and screen and execute part of the test cases according to the affected interface functions to improve the test efficiency.
In the prior art, when analyzing the interface function affected by the above change, a tester usually only concerns whether the interface function of the software itself changes or whether the interface function of other software associated with the software changes. When the interface function of the software changes, a tester can directly take the changed interface function as the affected interface function. When the interface function of other software associated with the software changes, a tester may take the changed interface function in the other software as an objective function, may acquire an interface function having a call relationship with the objective function from the software, and may take the acquired interface function as an affected interface function.
In the process of implementing the present application, the inventor finds that at least the following problems exist in the prior art:
in the above prior art, when analyzing the interface function affected by the above change, the tester usually only pays attention to whether the interface function of the software itself changes or whether the interface function of other software associated with the software changes. However, changes in the non-interface functions of the software itself, or changes in the non-interface functions of other software associated with the software, may also affect the interface functions of the software. Therefore, the above prior art cannot accurately analyze the interface function affected by the software change, which may cause that a tester cannot screen out a proper test case.
Disclosure of Invention
The embodiment of the application aims to provide a function obtaining method, a function obtaining device and a server so as to accurately analyze an interface function influenced by software change and help a tester to screen out a proper test case.
The method, the device and the server for acquiring the function are realized in the following modes:
a method of function acquisition, the method comprising:
acquiring a function identifier of a function which is changed in a first service system, and using the function identifier as a function identifier in a function identifier set;
constructing a node correlation network; wherein the node association network comprises at least one node; each node is a function identification of a function in the second service system; the node association network comprises directed association relations among nodes;
acquiring at least one interface node from the node association network based on the function identifier in the function identifier set by using the directed association relation among the nodes; the interface node is a node in the node association network, and the directed association relationship is not pointed to by other nodes.
A server, the server comprising a memory and a processor;
the memory to store computer program instructions;
the processor is used for reading and executing the computer program instructions; acquiring a function identifier of a function which is changed in a first service system, and using the function identifier as a function identifier in a function identifier set; constructing a node correlation network; wherein the node association network comprises at least one node; each node is a function identification of a function in the second service system; the node association network comprises directed association relations among nodes; acquiring at least one interface node from the node association network based on the function identifier in the function identifier set by using the directed association relation among the nodes; the interface node is a node in the node association network, and the directed association relationship is not pointed to by other nodes.
A function acquisition apparatus, the apparatus comprising:
a function identifier acquiring unit, configured to acquire a function identifier of a function that is changed in the first service system, as a function identifier in the function identifier set;
a node correlation network construction unit, configured to construct a node correlation network; wherein the node association network comprises at least one node; each node is a function identification of a function in the second service system; the node association network comprises directed association relations among nodes;
an interface node obtaining unit, configured to obtain at least one interface node from the node association network based on the function identifier in the function identifier set by using the directed association relationship between the nodes; the interface node is a node in the node association network, and the directed association relationship is not pointed to by other nodes.
According to the technical scheme provided by the embodiment of the application, the server in the embodiment of the application can obtain the function identifier of the changed function in the first service system as the function identifier in the function identifier set; a node association network can be constructed, wherein the node association network comprises at least one node, each node is a function identifier of a function in the second service system, and the node association network comprises a directed association relation between the nodes; at least one interface node can be obtained from the node association network based on the function identifier in the function identifier set by using the directed association relationship among the nodes, wherein the interface node is a node which is not pointed by other nodes in the directed association relationship in the node association network. Compared with the prior art, the first service system and the second service system can be the same or different; the function identification set may include a function identification of an interface function or a function identification of a non-interface function that is changed in the first service system. Therefore, the server in the embodiment of the application can analyze the interface function influenced by the change of the interface function or the non-interface function of the software and the change of other software interface functions or non-interface functions associated with the software. Therefore, the method and the device for testing the interface function can accurately analyze the interface function influenced by software change, and can help a tester to screen out a proper test case.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a flowchart of a function obtaining method according to an embodiment of the present application
Fig. 2 is a schematic diagram of a node association network according to an embodiment of the present application;
fig. 3 is a schematic diagram of another node association network according to an embodiment of the present application;
fig. 4 is a functional structure diagram of a server according to an embodiment of the present application;
fig. 5 is a schematic functional structure diagram of a function obtaining apparatus according to an embodiment of the present application;
fig. 6 is a flowchart of acquiring at least one interface node from a node association network according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Please refer to fig. 1. The embodiment of the application provides a function obtaining method. The function acquisition method takes a server as an execution subject. The server may be one server or a server cluster including a plurality of servers. The function acquisition method may include the following steps.
Step S11: and acquiring a function identifier of the changed function in the first service system as the function identifier in the function identifier set.
In this embodiment, the number of the first service coefficients may be one or more. The first service system may be, for example, a service system such as a balance treasure, a fund, a periodic system, and the like. The functions are understood to be a set of computer program instructions capable of performing certain functions. The function identifier may be used to identify a function, and specifically may be a name or a code of the function. For example, the function identification of the product information query function QueryProductById () may be the name QueryProductById of the product information query function.
In this embodiment, the number of functions in the first service system may be one or more. The change of the source code of the first service system may cause the change of the interface function and/or the non-interface function of the first service system. For example, a developer fixes a software bug of the first business system, which may result in a change of an interface function and/or a non-interface function of the first business system. In this way, the server can acquire the source code of the current version and the source code of the historical version of the first business system through a version control tool; the method comprises the steps that a function identifier of a function changed by a first business system can be obtained based on a source code of a current version and a source code of a historical version of the first business system; the function identifier of the function in which the first service system is changed may be used as the function identifier in the function identifier set. Wherein, the version control tool is computer software for providing software version management function and storing, recording and tracking software version modification history. The version control tool may be, for example, SVN (version, a cross-platform open source version control tool), Git (an open source distributed version control tool), or the like. The function of the first service system change can be, for example, a newly added function, a modified function, a deleted function, and the like.
The server may compare the source code of the current version with the source code of the historical version of the first service system to obtain a function identifier of a function in which the first service system changes. Of course, the server may also construct an abstract syntax tree of the source code of the current version and an abstract syntax tree of the source code of the historical version of the first service system; the method includes the steps that function identifications of all functions in the current version of the first service system can be obtained based on an abstract syntax tree of a source code of the current version of the first service system and serve as function identifications in a first function identification set; function identifiers of functions in the historical version of the first service system can be obtained based on the abstract syntax tree of the source code of the historical version of the first service system and serve as function identifiers in a second function identifier set; the function identifier in the first function identifier set and the function identifier in the second function identifier set may be compared to obtain the function identifier of the function that the first service system changes. Wherein, the Abstract Syntax Tree (AST) is a Tree representation of the source code Abstract Syntax structure.
Alternatively, in this embodiment, in order to simplify the implementation of the first business system, for a relatively mature function, a developer may introduce a third-party computer program for implementing the function into the first business system. The third party computer program may be an open source package, such as Spring (an open source framework), Struts (an open source framework), and the like. Here, a third party computer program introduced by the first business system may be a component of the first business system. That is, the first business system may be considered to include the third party computer program. In this way, the server can obtain the source code of the current version and the source code of the historical version of the third-party computer program; the method comprises the steps of obtaining a function identifier of a function of the third-party computer program which is changed based on a source code of a current version and a source code of a historical version of the third-party computer program; the function identifier of the function in which the third-party computer program is changed can be used as the function identifier in the function identifier set. The function of the third-party computer program that is changed may be, for example, a newly added function, a modified function, a deleted function, and the like.
The server may compare the source code of the current version with the source code of the historical version of the third-party computer program to obtain a function identifier of a function in which the third-party computer program changes. Of course, the server may also obtain the bytecode of the current version of the third-party computer program based on the source code of the current version of the third-party computer program; analyzing the bytecode of the current version of the third-party computer program through a bytecode manipulation frame to obtain function identifications of each function in the current version of the third-party computer program, wherein the function identifications are used as function identifications in a third function identification set; the bytecode of the historical version of the third-party computer program can be acquired based on the source code of the historical version of the third-party computer program; analyzing the bytecode of the third-party computer program historical version through a bytecode manipulation frame to obtain function identifiers of all functions in the third-party computer program historical version as function identifiers in a fourth function identifier set; the function identifiers in the third function identifier set and the fourth function identifier set may be compared to obtain the function identifier of the function that the third-party computer program changes. Wherein the bytecode manipulation framework is computer software for creating, modifying and analyzing the bytecode of the computer program. The bytecode manipulation framework can be, for example, ASM, AspectJ, BCEL, Byte Buddy, CGLIB, Cojen, javasissst, Serp, etc. The bytecode (Byte-code) is a binary file that contains the execution program and is composed of a sequence of op code and/or data pairs. The bytecode can be understood as an intermediate code, which is more abstract than machine code.
Step S12: and constructing a node association network.
In this embodiment, the node-associated network may include one or more nodes, and each node may correspond to a function identifier of a function in the second service system. The node association network may further include a directed association relationship between nodes. The directed association relationship between the nodes can be understood as a directed relationship between the nodes. In particular, in the node association network, each node may have a directed association relationship with one or more other nodes. That is, in the node-associated network, each node may point to 0, 1, or more other nodes, and each node may also be pointed to by 0, 1, or more other nodes. Nodes in the node association network that are not pointed to by other nodes may be referred to as interface nodes. That is, the node pointed to by 0 nodes in the node-associated network may be used as an interface node. The corresponding function of the interface node in the second service system is typically an interface function.
The number of the second traffic coefficients may be one or more. The second service system may be, for example, a service system such as a balance treasure, a fund, a periodic system, and the like. The second service system and the first service system may be the same or different. When the second business system is different from the first business system, the second business system and the first business system may have an association relationship. Here, the second service system and the first service system have an association relationship, which may be understood as: and service data interaction can be carried out between the second service system and the first service system. For example, the second business system may receive and process business data from the first business system, and the business data may include transaction amount, and the like.
In this embodiment, the number of functions in the second service system may be one or more. The server can obtain function identification of functions in the second service system and call relation among the functions; the function identifier of the function in the second service system may be used as a node, and a node association network may be constructed based on the call relationship between the functions in the second service system.
For example, the second service system may include functions Function _ a (), Function _ B (), Function _ C (), Function _ D (), and Function _ E (). The Function _ a () may call the functions Function _ B (), Function _ C (), and Function _ D (). The functions Function _ C (), Function _ D () can call the Function _ E (), respectively. The Function identification of the Function _ a () may be Function _ a; the Function identification of the Function _ B () may be Function _ B; the Function identification of the Function _ C () may be Function _ C; the Function identification of the Function _ D () may be Function _ D; the Function identification of the Function _ E () may be Function _ E.
Then, the server may use the Function identifier Function _ a as the node Function _ a, the Function identifier Function _ B as the node Function _ B, the Function identifier Function _ C as the node Function _ C, the Function identifier Function _ D as the node Function _ D, and the Function identifier Function _ E as the node Function _ E to construct the node-associated network shown in fig. 2. In the node-associated network shown in fig. 2, the node Function _ a may point to the node Function _ B, Function _ C, Function _ D, and the node Function _ C and the node Function _ D may point to the node Function _ E, respectively. In the node-associated network shown in fig. 2, the node Function _ a may be an interface node.
In this embodiment, the server may obtain a bytecode of the second service system; the bytecode of the second service system can be analyzed by using a bytecode manipulation framework to obtain function identifiers of functions in the second service system and call relations among the functions.
In an implementation manner of this embodiment, the server may obtain, from the bytecode of the second service system, a function identifier of a function in the second service system. The source code of the second business system may be, for example, as follows.
Figure BDA0001326419100000061
Figure BDA0001326419100000071
Correspondingly, the bytecode of the second service system may be as follows.
Figure BDA0001326419100000072
Then the server may obtain A, B, C, D, E, F a function identification for the function in the second service system from the bytecode of the second service system.
In one embodiment of this embodiment, the call relationship between functions may include a direct call relationship and an indirect call relationship.
For example, the Function _ a () Function body includes computer program instructions for calling the Function _ B (). Then, it can be considered that the Function _ a () directly calls the Function _ B ().
As another example, the Function _ a () Function body includes computer program instructions for sending a message and the Function _ C () Function body includes computer program instructions for receiving the message. Then, the Function _ a () and the Function _ C () can be considered to be associated through the message, and specifically, the Function _ a () can be considered to indirectly call the Function _ C () through the message.
In this embodiment, a preset key in the bytecode may be used to identify the call relationship between functions.
For example, the Function _ a () bytecode includes 2 preset keywords invokevirtual, one of which corresponds to the Function identification Function _ B, and the other of which corresponds to the Function identification Function _ D. Then, it can be considered that the Function _ a () directly calls the Function _ B () which can be a Function identified by the Function identification Function _ B, and the Function _ D () which can be a Function identified by the Function identification Function _ D, respectively.
For another example, the Function _ a () bytecode includes a preset Function identifier, a preset keyword TP, and a preset keyword EC, where the preset Function identifier may be a Function identifier of a Function used for sending a message. Then, the Function _ a () can be considered for sending a message. Specifically, for example, in the Function _ a () bytecode, the attribute value corresponding to the preset key TP may be TPXXX, and the attribute value corresponding to the preset key EC may be ECXXX. Then, the Function _ a () may be considered to be used to transmit the Message _ TPXXX _ ECXXX, and the attribute values of the Message _ TPXXX _ ECXXX may include TPXXX and ECXXX.
The Function _ C () bytecode includes a preset keyword concumer, a preset keyword TP, and a preset keyword EC. Then, the Function _ C () can be considered for receiving a message. Specifically, for example, in the bytecode of the Function _ C (), the attribute value corresponding to the preset key TP may be TPXXX, and the attribute value corresponding to the preset key EC may be ECXXX. Then, the Function _ C () can be considered to be used to receive the Message _ TPXXX _ ECXXX.
Then, the Function _ a () and the Function _ C () may be considered to be associated by the Message _ TPXXX _ ECXXX, and specifically, the Function _ a () may be considered to indirectly call the Function _ C () by the Message _ TPXXX _ ECXXX.
As such, in this embodiment, for each function in the second service system, the server may obtain the function bytecode from the second service system bytecode; under the condition that the function byte code comprises at least one first preset keyword, acquiring a function identifier corresponding to each first preset keyword in the function byte code; the function can be identified, and the calling relation between the functions identified by the function identification corresponding to each first preset keyword is respectively identified. Specifically, the server may identify that the function is respectively and directly called, and each first preset keyword corresponds to the function identified by the function identifier. The first preset keyword may be invokevirtual, for example.
Or, in this embodiment, for each function in the second service system, the server may obtain the function bytecode from the second service system bytecode; under the condition that the function byte code comprises a second preset keyword and a third preset keyword, a corresponding first attribute value of the second preset keyword in the function byte code can be obtained; a second attribute value corresponding to a third preset keyword in the function byte code can be obtained; this function may be taken as the first function. The second preset keyword may be TP, for example, and the third preset keyword may be EC, for example.
The server may obtain a second function from the second service system. Wherein the second function is different from the first function. The second function may include a second preset keyword and a third keyword. The attribute value of the second preset keyword in the second function byte code is the same as the first attribute value; and the attribute value of the third preset keyword in the second function byte code is the same as the second attribute value. The server may then identify a call relationship between the first function and the second function.
Further, the server may identify whether the first function bytecode and the second function bytecode include a preset function identifier or a fourth preset keyword, respectively. The fourth preset keyword may be, for example, a Consumer, and the preset function identifier may be a function identifier of a function used for sending a message. Under the condition that the first function bytecode is recognized to contain the preset function identifier and the second function bytecode is recognized to contain the fourth preset keyword, the server can recognize that the first function indirectly calls the second function. Under the condition that the first function bytecode and the second function bytecode are recognized to contain the fourth preset keyword and the preset function identifier, the server can recognize that the second function indirectly calls the first function.
Step S13: and acquiring at least one interface node from the node association network by using the directed association relation among the nodes in the node association network based on the function identifiers in the function identifier set.
In this embodiment, as described above, the node association network may include a directed association relationship between nodes. Nodes in the node association network that are not pointed to by other nodes may serve as interface nodes. Thus, for each function identifier in the function identifier set, the server may obtain a node corresponding to the function identifier in the node association network; under the condition that the acquisition node is an interface node, the interface node corresponding to the function identifier can be acquired; under the condition that the acquisition node is not an interface node, the acquisition node can be used as a target node, and the directed association relation can be acquired from the node association network as the interface node pointing to the target node. Here, the server obtains the corresponding node of the function identifier in the node association network, which may be understood as; searching a node with the same function identifier in the node correlation network; here, the directed association relationship is an interface node pointing to the target node, and may include: the directed association is an interface node that points directly to the target node, or the directed association is an interface node that points indirectly to the target node via one or more intermediate nodes.
Please refer to fig. 6. Specifically, the server may obtain one function identifier in the set of function identifiers; the node corresponding to the function identifier in the node association network can be obtained; under the condition that the acquisition node is an interface node, the interface node corresponding to the function identifier can be acquired, and the function identifier can be deleted from the function identifier set; under the condition that the obtaining node is not an interface node, the obtaining node may be used as a target node, at least one node having a directed association relationship directly pointing to the target node may be obtained from the node association network, each node in the at least one node may be used as a function identifier in the function identifier set, and the function identifier may be deleted from the function identifier set. The server may repeatedly perform the above process until the number of function identifiers in the set of function identifiers is 0.
Of course, in this embodiment, the server may further obtain at least one interface node from the node association network by using a preset algorithm. The preset algorithm may be, for example, a Breadth-First-Search algorithm (break-First-Search), a Depth-First-Search algorithm (Depth-First-Search), or the like.
For example, the node association network may be as shown in fig. 3. In the node-associated network shown in fig. 3, the nodes CreateTrade and CloseTrade are interface nodes. The set of function identifications may include function identifications queryproductByld and CreateTrade.
Then, for the function identifier CreateTrade in the function identifier set, the server may obtain the node CreateTrade corresponding to the function identifier CreateTrade from the node association network. The node CreateTrade may be an interface node. Therefore, the server can directly obtain the interface node CreateTrade, and can delete the function identifier CreateTrade from the function identifier set. At this time, the function identification set may include a function identification queryProductByld.
For a function identifier queryProductByld in the function identifier set, the server may obtain a node queryProductByld corresponding to the function identifier queryProductByld from the node association network. The node queryproductByld is not an interface node, and the server can acquire a node CreatePartNerP2PTradeAction with a directed incidence relation directly pointing to the node queryproductByld from the node incidence network; the node CreatePartnerP2 ptradaction may be used as a function identifier in the function identifier set; the function identification queryProductByld may be deleted from the set of function identifications. At this time, the function identification set may include a function identification queryProductByld.
For a function identifier queryProductByld in the function identifier set, the server may obtain a node queryProductByld corresponding to the function identifier queryProductByld from the node association network. The node queryProductByld is not an interface node, and the server can acquire a node CreateTrade of which the directed association relationship is directly pointing to the node queryProductByld from the node association network; the node CreateTrade can be used as a function identifier in the function identifier set; the function identity CreateTrade may be deleted from the set of function identities. At this time, the function identification set may include a function identification CreateTrade.
For the function identifier CreateTrade in the function identifier set, the server may obtain a node CreateTrade corresponding to the function identifier CreateTrade from the node association network. The node CreateTrade may be an interface node. Therefore, the server can directly obtain the interface node CreateTrade, and can delete the function identifier CreateTrade from the function identifier set. At this time, the number of function identifiers in the function identifier set may be 0. Thus, the server can end the interface node acquisition process.
In this embodiment, the server may obtain a function identifier of a function that has changed in the first service system, as a function identifier in the function identifier set; a node association network can be constructed, wherein the node association network comprises at least one node, each node is a function identifier of a function in the second service system, and the node association network comprises a directed association relation between the nodes; at least one interface node can be obtained from the node association network based on the function identifier in the function identifier set by using the directed association relationship among the nodes, wherein the interface node is a node which is not pointed by other nodes in the directed association relationship in the node association network. Compared with the prior art, the first service system and the second service system can be the same or different; the function identification set may include a function identification of an interface function or a function identification of a non-interface function that is changed in the first service system. Therefore, the server of the embodiment can analyze the interface function affected by the change of the interface function or the non-interface function of the software, and the change of other software interface functions or non-interface functions associated with the software. Therefore, the embodiment can accurately analyze the interface function influenced by the software change, thereby helping a tester to screen out a proper test case.
Please refer to fig. 4. The embodiment of the application also provides a server. The server may include a memory and a processor.
In this embodiment, the Memory includes, but is not limited to, a hard disk, a usb disk, a RAM (Random-Access Memory), a ROM (Read-Only Memory), and the like. The memory may be used to store computer program instructions.
In this embodiment, the processor may be implemented in any suitable manner. For example, the processor may take the form of, for example, a microprocessor or processor and a computer-readable medium that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, an embedded microcontroller, and so forth.
In this embodiment, the processor may be configured to read and execute the computer program instructions; acquiring a function identifier of a function which is changed in a first service system, and using the function identifier as a function identifier in a function identifier set; constructing a node correlation network; wherein the node association network comprises at least one node; each node is a function identification of a function in the second service system; the node association network comprises directed association relations among nodes; acquiring at least one interface node from the node association network based on the function identifier in the function identifier set by using the directed association relation among the nodes; the interface node is a node in the node association network, and the directed association relationship is not pointed to by other nodes.
The specific functions of the server, its memory and processor, which are disclosed in the embodiments of the present application, can be explained in contrast to the foregoing embodiments in the present application.
Please refer to fig. 5. The embodiment of the application also provides a function acquisition device. The device comprises a function identification obtaining unit 51, a node association network constructing unit 52 and an interface node obtaining unit 53. Wherein the content of the first and second substances,
a function identifier obtaining unit 51, configured to obtain a function identifier of a function that is changed in the first service system, as a function identifier in the function identifier set;
a node-associated network construction unit 52 configured to construct a node-associated network; wherein the node association network comprises at least one node; each node is a function identification of a function in the second service system; the node association network comprises directed association relations among nodes;
an interface node obtaining unit 53, configured to obtain at least one interface node from the node association network based on the function identifier in the function identifier set by using the directed association relationship between the nodes; the interface node is a node in the node association network, and the directed association relationship is not pointed to by other nodes.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment is described with emphasis on differences from other embodiments. In particular, for server and computer storage media embodiments, because they are substantially similar to method embodiments, the description is relatively simple, and reference may be made to some descriptions of method embodiments for relevant points.
In addition, it is understood that one skilled in the art, after reading this document, may conceive of combinations of some or all of the embodiments recited in this document without the need for inventive faculty, which combinations are also within the scope of the disclosure and protection of this document.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate a dedicated integrated circuit chip 2. Furthermore, nowadays, instead of manually making an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardsradware (Hardware Description Language), vhjhd (Hardware Description Language), and vhigh-Language, which are currently used in most popular applications. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
While the present application has been described with examples, those of ordinary skill in the art will appreciate that there are numerous variations and permutations of the present application without departing from the spirit of the application, and it is intended that the appended claims encompass such variations and permutations without departing from the spirit of the application.

Claims (12)

1. A method of function acquisition, the method comprising:
acquiring a function identifier of a function which is changed in a first service system, and using the function identifier as a function identifier in a function identifier set;
constructing a node correlation network; wherein the node association network comprises at least one node; each node is a function identification of a function in the second service system; the node association network comprises directed association relations among nodes;
acquiring at least one interface node from the node association network based on the function identifier in the function identifier set by using the directed association relation among the nodes; the interface node is a node in the node association network, and the directed association relationship is not pointed to by other nodes.
2. The method according to claim 1, wherein said obtaining the function id of the function that has changed in the first service system as the function id in the function id set comprises:
and acquiring a function identifier of a changed function in the first service system based on the source code of the current version and the source code of the historical version of the first service system, wherein the function identifier is used as a function identifier in a function identifier set.
3. The method of claim 1, the first business system comprising a third party computer program; correspondingly, the obtaining a function identifier of a function that has changed in the first service system, as a function identifier in the function identifier set, includes:
and acquiring a function identifier of a function which is changed in the third-party computer program based on the source code of the current version and the source code of the historical version of the third-party computer program, wherein the function identifier is used as a function identifier in a function identifier set.
4. The method of claim 1, the constructing a node association network, comprising:
acquiring function identifiers of functions in the second service system and call relations among the functions;
and taking the function identifier of the function in the second service system as a node, and constructing a node association network based on the call relation among the functions in the second service system.
5. The method of claim 4, wherein the obtaining the function identifier of the function in the second service system and the call relationship between the functions comprises:
and analyzing the byte codes of the second service system by using a byte code operation frame to obtain the function identifiers of the functions in the second service system and the calling relation among the functions.
6. The method of claim 5, wherein the parsing the bytecode of the second business system using the bytecode manipulation framework to obtain the call relation between functions in the second business system comprises:
identifying a preset keyword in the second service system bytecode by using a bytecode manipulation framework;
and identifying the calling relation among the functions in the second service system based on the preset keywords in the byte codes of the second service system.
7. The method of claim 6, the preset keyword comprising a first preset keyword; correspondingly, the identifying a call relationship between functions in the second service system based on a preset keyword in the bytecode of the second service system includes:
for each function in the second service system, under the condition that the function byte code comprises at least one first preset keyword, acquiring a function identifier corresponding to each first preset keyword in the function byte code;
and identifying the function, and respectively associating the function with the calling relationship among the functions identified by the function identification corresponding to each first preset keyword.
8. The method of claim 6, wherein the preset keywords comprise a second preset keyword and a third preset keyword; correspondingly, the identifying a call relationship between functions in the second service system based on a preset keyword in the bytecode of the second service system includes:
acquiring a first function from the second service system; the first function byte comprises a second preset keyword and a third preset keyword;
acquiring a first attribute value corresponding to a second preset keyword in the first function byte code and a second attribute value corresponding to a third preset keyword in the first function byte code;
acquiring a second function from the second service system; the second function byte code comprises a second preset keyword and a third preset keyword; the attribute value of a second preset keyword in the second function byte code is the same as the first attribute value; the corresponding attribute value of a third preset keyword in the second function byte code is the same as the second attribute value;
and identifying a calling relation between the first function and the second function.
9. The method of claim 1, the obtaining at least one interface node from the node association network, comprising:
and aiming at each function identifier in the function identifier set, acquiring the interface node corresponding to the function identifier under the condition that the corresponding node of the function identifier in the node association network is the interface node.
10. The method of claim 1, the obtaining at least one interface node from the node association network, comprising:
and aiming at each function identifier in the function identifier set, under the condition that the corresponding node of the function identifier in the node association network is not an interface node, taking the corresponding node of the function identifier in the node association network as a target node, and acquiring a directed association relationship from the node association network as the interface node pointing to the target node.
11. A server, the server comprising a memory and a processor;
the memory to store computer program instructions;
the processor is used for reading and executing the computer program instructions; acquiring a function identifier of a function which is changed in a first service system, and using the function identifier as a function identifier in a function identifier set; constructing a node correlation network; wherein the node association network comprises at least one node; each node is a function identification of a function in the second service system; the node association network comprises directed association relations among nodes; acquiring at least one interface node from the node association network based on the function identifier in the function identifier set by using the directed association relation among the nodes; the interface node is a node in the node association network, and the directed association relationship is not pointed to by other nodes.
12. A function acquisition apparatus, the apparatus comprising:
a function identifier acquiring unit, configured to acquire a function identifier of a function that is changed in the first service system, as a function identifier in the function identifier set;
a node correlation network construction unit, configured to construct a node correlation network; wherein the node association network comprises at least one node; each node is a function identification of a function in the second service system; the node association network comprises directed association relations among nodes;
an interface node obtaining unit, configured to obtain at least one interface node from the node association network based on the function identifier in the function identifier set by using the directed association relationship between the nodes; the interface node is a node in the node association network, and the directed association relationship is not pointed to by other nodes.
CN201710468198.XA 2017-06-20 2017-06-20 Function acquisition method and device and server Active CN107451050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710468198.XA CN107451050B (en) 2017-06-20 2017-06-20 Function acquisition method and device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710468198.XA CN107451050B (en) 2017-06-20 2017-06-20 Function acquisition method and device and server

Publications (2)

Publication Number Publication Date
CN107451050A CN107451050A (en) 2017-12-08
CN107451050B true CN107451050B (en) 2020-07-03

Family

ID=60486527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710468198.XA Active CN107451050B (en) 2017-06-20 2017-06-20 Function acquisition method and device and server

Country Status (1)

Country Link
CN (1) CN107451050B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111176857B (en) * 2018-11-12 2024-06-11 北京数安鑫云信息技术有限公司 Method and device for intelligently providing data
CN111382070B (en) * 2020-03-03 2022-03-04 腾讯科技(深圳)有限公司 Compatibility testing method and device, storage medium and computer equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6553429B1 (en) * 1998-06-05 2003-04-22 Microsoft Corporation Fast conditional thunk utility
CN102831060A (en) * 2012-08-24 2012-12-19 东南大学 Modification influence analysis based regression test case updating method of part software
CN104834603A (en) * 2015-05-26 2015-08-12 牟永敏 Regression-testing-oriented control flow change influence domain analyzing method and system
CN105205000A (en) * 2015-10-12 2015-12-30 用友网络科技股份有限公司 Method and system for positioning influenced code scope in software development
CN105389262A (en) * 2015-12-23 2016-03-09 北京奇虎科技有限公司 Method and device for generating test suggestions in allusion to interface tests
CN106020848A (en) * 2016-06-07 2016-10-12 北京信息科技大学 Function calling route generating method oriented to C#

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6553429B1 (en) * 1998-06-05 2003-04-22 Microsoft Corporation Fast conditional thunk utility
CN102831060A (en) * 2012-08-24 2012-12-19 东南大学 Modification influence analysis based regression test case updating method of part software
CN104834603A (en) * 2015-05-26 2015-08-12 牟永敏 Regression-testing-oriented control flow change influence domain analyzing method and system
CN105205000A (en) * 2015-10-12 2015-12-30 用友网络科技股份有限公司 Method and system for positioning influenced code scope in software development
CN105389262A (en) * 2015-12-23 2016-03-09 北京奇虎科技有限公司 Method and device for generating test suggestions in allusion to interface tests
CN106020848A (en) * 2016-06-07 2016-10-12 北京信息科技大学 Function calling route generating method oriented to C#

Also Published As

Publication number Publication date
CN107451050A (en) 2017-12-08

Similar Documents

Publication Publication Date Title
CN108027722B (en) Dynamically updating applications in compilation and deployment
Franks et al. Cacheca: A cache language model based code suggestion tool
US10481964B2 (en) Monitoring activity of software development kits using stack trace analysis
US10261889B2 (en) Techniques for edit-and-continue and enhanced optimized debugging on optimized code
CN107239392B (en) Test method, test device, test terminal and storage medium
CN109032825B (en) Fault injection method, device and equipment
US9652209B2 (en) Static analysis and reconstruction of deep link handling in compiled applications
CN107480476B (en) Android native layer instruction compiling virtualization shell adding method based on ELF infection
CN108415998B (en) Application dependency relationship updating method, terminal, device and storage medium
US20140298290A1 (en) Identification of code changes using language syntax and changeset data
CN109284222B (en) Software unit, project testing method, device and equipment in data processing system
CN107451050B (en) Function acquisition method and device and server
CN111159040A (en) Test data generation method, device, equipment and storage medium
CN114840427A (en) Code testing and test case generating method and device
CN109582382B (en) Loading method and device of configuration information, storage medium and terminal equipment
CN112069052A (en) Abnormal object detection method, device, equipment and storage medium
CN114115884B (en) Method and related device for managing programming service
CN108073401B (en) Method and device for executing business logic and electronic equipment
CN110941443B (en) Method and device for modifying file name in SDK (software development kit) and electronic equipment
CN112698867A (en) Method and device for dynamically modifying annotation information, electronic equipment and medium
CN111385661B (en) Method, device, terminal and storage medium for voice control of full screen playing
CN113467815A (en) Application repair method and device for hot update, terminal equipment and storage medium
CN109145084B (en) Data processing method, data processing device and server
CN112612474A (en) Product transplanting method and device, storage medium and electronic equipment
US10417017B2 (en) Determining candidate patches for a computer software

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
TR01 Transfer of patent right

Effective date of registration: 20201019

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201019

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: Greater Cayman, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right