A method, apparatus and electronic device for determining an application program interface
By obtaining the attributes of application components, matching interfaces are automatically determined from the interface database and search model, solving the problem of low efficiency in manual interface selection in existing technologies, and achieving more efficient and accurate binding of application components and interfaces.
Patent Information
- Application Number
- CN202210324858.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-03-30
AI Technical Summary
In existing technologies, the selection of application component interfaces relies on manual processing, resulting in low development efficiency.
By acquiring the properties of application components, including project properties and status properties, the system automatically determines the matching interface from a large number of interfaces, and improves the stability and accuracy of the selection by utilizing an interface database and search model.
It enables automatic matching of application components and interfaces, improving development efficiency and binding accuracy, and reducing the instability and error rate of manual selection.
Smart Images

Figure CN114895897B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of software development, and more particularly, to a method and device for determining an application program interface and an electronic device. BACKGROUND
[0002] Currently, the interface selection of application components is generally manually processed, which highly depends on the personal experience of developers, resulting in low development efficiency. SUMMARY
[0003] Therefore, the present application provides the following technical solutions.
[0004] A method for determining an application program interface, comprising:
[0005] in response to a first interface search instruction of a first application component being triggered, obtaining a first attribute;
[0006] determining a matched interface according to the first attribute;
[0007] The first attribute includes an attribute of a first item triggering the first interface search instruction and / or a state attribute of the first application component.
[0008] Optionally, the determining of the matched interface according to the first attribute comprises:
[0009] determining a functional feature of the first application component according to the attribute of the first item;
[0010] determining a service network attribute of the first application component according to the state attribute of the first application component;
[0011] determining the matched interface based on the functional feature and the service network attribute of the first application component.
[0012] Optionally, the determining of the functional feature of the first application component according to the attribute of the first item comprises:
[0013] analyzing and determining the functional feature of the first application component according to code information of the first item;
[0014] The determining of the service network attribute of the first application component according to the state attribute of the first application component comprises:
[0015] determining the service network attribute of the first application component according to address information or network usage information of a bearing device of the first application component.
[0016] Optionally, the state attribute of the first application component comprises configuration data and service network attribute of the carrying device of the first application component, and the determining the matched interface according to the first attribute comprises:
[0017] determining the interface matched with the configuration data of the carrying device according to the attribute of the first item and the state attribute of the first application component.
[0018] Optionally, the first interface searching instruction comprises a keyword, and the determining the matched interface according to the first attribute comprises:
[0019] determining the interface matched with the keyword from a pre-established interface database according to the first attribute.
[0020] Optionally, the establishment of the interface database comprises:
[0021] communicating the internet interface service and the enterprise internal interface service of different network regions with the development platform of the first item;
[0022] storing the interfaces of different network regions according to business attributes to obtain an interface database available for the first application component.
[0023] Optionally, the determining the matched interface according to the first attribute comprises:
[0024] determining the matched interface based on an interface searching model and the first attribute;
[0025] the establishment of the interface searching model comprises:
[0026] obtaining a sample data set, and the sample data in the sample data set comprises a binding relationship between an application component and an interface;
[0027] determining searching weights of various factors based on the service network region and the functional feature of the application component in the sample data, wherein the factors comprise the service network region and the functional feature;
[0028] constructing an interface searching model based on the binding relationship and the searching weights.
[0029] Optionally, the determining the matched interface according to the first attribute comprises:
[0030] determining at least one matched interface according to the first attribute;
[0031] when there are at least two matched interfaces, further comprising:
[0032] sequentially outputting the at least two matched interfaces in order of descending matching degree.
[0033] The application further discloses a device for determining an application program interface, comprising:
[0034] an attribute obtaining module, configured to obtain a first attribute in response to a first interface search instruction of a first application component being triggered;
[0035] an interface determining module, configured to determine a matched interface according to the first attribute;
[0036] The first attribute comprises an attribute of a first item triggering the first interface search instruction and / or a state attribute of the first application component.
[0037] Further, the application further discloses an electronic device, comprising:
[0038] a processor;
[0039] a memory, configured to store executable program instructions of the processor;
[0040] The executable program instructions comprise: obtaining a first attribute in response to a first interface search instruction of a first application component being triggered; and determining a matched interface according to the first attribute; wherein the first attribute comprises an attribute of a first item triggering the first interface search instruction and / or a state attribute of the first application component.
[0041] According to the technical solution described above, compared with the prior art, the application discloses a method, device and electronic device for determining an application program interface, the method comprising: obtaining a first attribute in response to a first interface search instruction of a first application component being triggered; and determining a matched interface according to the first attribute; wherein the first attribute comprises an attribute of a first item triggering the first interface search instruction and / or a state attribute of the first application component. The above solution can determine an interface suitable for the first application component from a plurality of interfaces according to the attribute of the first item triggering the first interface search instruction and / or the state attribute of the first application component. Since the determined interface has logical relevance with the first application component, the stability and accuracy of the interface selected by the solution are better than those of the interface selected by manual selection. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the application embodiments or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of the provided drawings.
[0043] Figure 1A flowchart of a method for determining an application program interface is disclosed in the embodiments of the present application.
[0044] Figure 2 A flowchart of determining a matching interface is disclosed in the embodiments of the present application.
[0045] Figure 3 A flowchart of establishing an interface database is disclosed in the embodiments of the present application.
[0046] Figure 4 A flowchart of determining a matching interface is disclosed in the embodiments of the present application.
[0047] Figure 5 An implementation flowchart of determining an application program interface is disclosed in the embodiments of the present application.
[0048] Figure 6 A structural diagram of a device for determining an application program interface is disclosed in the embodiments of the present application.
[0049] Figure 7 A structural diagram of an electronic device is disclosed in the embodiments of the present application. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0051] The method for determining an application program interface described in the embodiments of the present application can be applied to various development platforms, which can include but are not limited to machine learning platforms, data analysis platforms, programming platforms, etc. The development platform can run on an electronic device, and the product form of the electronic device is not limited in the present application, which can include but is not limited to smart phones, tablet computers, wearable devices, personal computers (PCs), netbooks, etc. The specific selection can be made according to the needs of the actual application scene.
[0052] Figure 1 A flowchart of a method for determining an application program interface is disclosed in the embodiments of the present application. Referring to FIG. 1, Figure 1 The method for determining an application program interface can include:
[0053] Step 101: In response to a first interface search instruction of a first application component being triggered, a first attribute is acquired.
[0054] When the developer binds the interface for the first application component on the development platform, the developer needs to issue a first interface search instruction based on the first application component, and then the system can search for an interface that can meet the use requirement of the first application component for the first application component in the network based on the first interface search instruction. The interface can be an API (Application Programming Interface).
[0055] The first attribute can include, but is not limited to, an attribute of a first item triggering the first interface search instruction and / or a state attribute of the first application component. The first item can be an application being developed on the development platform. The attribute of the first item can include at least one of a project type, a project function, a project code, a project issuing area, and the like. The state attribute of the first application component can include an attribute of the first application component itself, such as a function feature, a business type, and the like. The state attribute of the first application component can also include a state attribute of an electronic device carrying the first application component, such as configuration information of the electronic device carrying the first application component, a network connection state, and the like. Of course, the specific content of the attribute of the first item and the state attribute of the first application component is only used as an example and does not constitute a specific limitation on the attribute of the first item and the state attribute of the first application component.
[0056] Step 102: determining a matched interface according to the first attribute.
[0057] After obtaining the first attribute, the interface meeting the requirement of the first application component can be determined from the network according to the first attribute. The interface meeting the requirement of the first application component and the first application component at least include the same attribute. For example, the service network of the first application component is a network in region A, and the service network of the interface meeting the requirement of the first application component is also a network in region A. The region A can refer to a country or an enterprise. When the region A refers to an enterprise, the service network in the region A is an intranet of the enterprise.
[0058] In one example, the first item is a game application, and the first application component is a component for capturing a B scene. In the implementation, an API interface that can read a scene database can be determined for the first application component based on the function feature (capturing the B scene) of the first application component.
[0059] The method for determining an application program interface can determine an interface suitable for the first application component from a plurality of interfaces according to the attribute of the first item triggering the first interface search instruction and / or the state attribute of the first application component. Since the determined interface has logical correlation with the first application component, the stability and accuracy of the selected interface are better than the implementation of manually selecting an interface.
[0060] Figure 2 The flowchart for determining a matching interface is disclosed in the embodiments of the present application. In combination with Figure 2 As shown in the above embodiments, the determining a matching interface according to the first attribute can include:
[0061] Step 201: determining the functional feature of the first application component according to the attribute of the first item.
[0062] As introduced in the foregoing content, the attribute of the first item has various implementations and can include different contents. The contents included in the attribute of the first item can directly indicate the functional feature of the first application component, or can obtain the functional feature of the first application component after analysis and processing.
[0063] For example, in one example, the first item is a database application, and the attribute introduction content of the database application describes that the business function of the first application component is data grabbing, and thus the functional feature of the first application component is data grabbing. In another example, the item type of the first item represents that the first item is a map application, and after analyzing the context content of the first application component, it is determined that the functional feature of the first application component is device positioning.
[0064] Step 202: determining the service network attribute of the first application component according to the state attribute of the first application component.
[0065] For example, the state attribute of the first application component is a network type and a network service range, and thus the service network attribute of the first application component can be determined based on the network type and the network service range. In one example, the network type of the first application component is a wide area network, and the network service range is China, and thus it can be determined that the service network attribute of the first application component is a China regional Internet.
[0066] In actual application, since the network area of an application service can be predefined in an application development platform, and the talent device of the application development platform also has a network area characteristic attribute, thus the API service in the corresponding network coverage range can be recommended to the application component selected by the developer according to the related network area characteristics.
[0067] Step 203: determining a matched interface based on the function feature of the first application component and the service network attribute.
[0068] After the function feature and the service network attribute of the first application component are determined, a matched API interface can be searched from the network based on the determined conditions. For example, the function feature of the first application component is to grab map data, and the service network attribute of the first application component is the China regional Internet, and the matched API interface can be an interface that can provide map data used in the China region.
[0069] In the above, the function feature of the first application component can be determined according to the attribute of the first item, which can include: analyzing and determining the function feature of the first application component according to the code information of the first item.
[0070] The code is a programming language, and the function feature of the first application component can be determined by identifying and analyzing the code information. For example, the content analyzed from the code in front of the first application component includes: obtaining weather information of a region; the content analyzed from the code behind the first application component includes: outputting and displaying the obtained weather information; and it can be determined that the function feature of the first application component is to grab weather information.
[0071] The service network attribute of the first application component can be determined according to the state attribute of the first application component, which can include: determining the service network attribute of the first application component according to the address information or network usage information of the carrying device of the first application component.
[0072] In the case of determining the address information of the carrying device of the first application component, the service network of the carrying device of the first application component can be determined, or the service network of the carrying device of the first application component can be directly determined based on the network usage information of the carrying device of the first application component.
[0073] In one implementation, the state attribute of the first application component includes the configuration data and the service network attribute of the carrying device of the first application component, and the matched interface can be determined according to the attribute of the first item and the state attribute of the first application component, which can include: determining an interface matched with the configuration data of the carrying device according to the attribute of the first item and the state attribute of the first application component.
[0074] The configuration data of the carrying device can include hardware configuration data. It can be understood that the hardware configurations of different electronic devices are different, including memory size, graphics card size, etc. And the input data size of some API interfaces will also be different based on their function features and data sources. Therefore, when selecting a matched interface for the first application component, it is also necessary to consider whether the input data size of the selected interface can be borne by the carrying device of the first application component.
[0075] For example, after determining the function feature and service network attribute of the first application component, it is determined that there are two API interfaces that meet the requirement of the first application component; wherein the first interface has an input data amount of about 1M, the second interface has an input data amount of 500kb, and the memory capacity of the bearing device of the first application component is relatively small, being 100kb, so in this case, the second interface is selected as the matched interface to be returned.
[0076] In one implementation, the first interface search instruction includes a keyword, and the determining the matched interface according to the first attribute can include determining the interface matching the keyword from the pre-established interface database according to the first attribute.
[0077] The interface in the interface database has an interface attribute, which can be used to determine which application components the interface meets the requirement of. In the embodiment of the application, the attribute of the interface can include, but is not limited to, a business attribute and a service network region.
[0078] The keyword can be the business function of the first application component, and the attribute of the function feature of the corresponding interface. For example, in one example, the business attribute of the first application component is to call a function service, and the interface database includes multiple interfaces that can provide the function service, and then the interface that is the same as the service network region of the first application component can be further determined from the interfaces that can provide the function service based on the service network region of the first application component.
[0079] The interface database is a pre-established database. Figure 3 A flowchart for establishing the interface database disclosed in the embodiment of the application is provided. Figure 3 As shown in the figure, the establishment of the interface database includes:
[0080] Step 301: The internet interface service and the enterprise internal interface service in different network regions are both communicated with the development platform of the first project.
[0081] Step 302: The interfaces in different network regions are classified and stored based on the business attribute, to obtain an interface database available for the first application component.
[0082] Specifically, the internet API service in different network regions and the enterprise internal API service of the development platform of the first project can be connected with the development platform of the first project through the network proxy mode by using the API proxy engine, and the API interfaces in different network regions can be classified by using a clustering algorithm, and the classified API interfaces are constructed into an interface database; thereby realizing unified data management, and providing unified information query of the API across the internal and external network regions.
[0083] The attribute information of the API interface based on the unified API database management includes at least API service attributes and API service network areas; and the APIs with similar service attributes are classified by a clustering algorithm, such as the APIs belonging to the weather forecast query classification, which provide different API interfaces for different service network areas.
[0084] In one implementation, the determining the matched interface according to the first attribute can include determining the matched interface based on an interface search model and the first attribute.
[0085] The interface search model can be established according to the method shown in Figure 4 . Figure 4 The flowchart of determining the matched interface is disclosed in the embodiments of the present application. As shown in Figure 4 , the establishment of the interface search model can include:
[0086] Step 401: obtaining a sample data set, the sample data in the sample data set including the binding relationship between the application component and the interface.
[0087] Step 402: determining the search weight of each factor based on the service network area and the functional feature of the application component in the sample data, wherein the factors include the service network area and the functional feature.
[0088] Step 403: constructing the interface search model based on the binding relationship and the search weight.
[0089] Specifically, the sample data of the binding relationship between the application component and the API interface used by each development platform can be collected, the weight of each factor in searching the API interface is calculated based on the factors such as the service network area and the component functional feature by a regression algorithm, and the interface search model is established. The regression algorithm is not fixed, such as a decision tree, a random forest algorithm, etc.
[0090] It can be understood that there are numerous API interfaces on the network, and the number of the available or matched API interfaces determined based on the first attribute of the first application component can include multiple. Therefore, the determining the matched interface according to the first attribute can include determining at least one matched interface according to the first attribute. When there are at least two matched interfaces, the method of determining the application program interface can further include sorting and outputting the at least two matched interfaces in the order from high to low of the matching degree.
[0091] The matching degree of each interface can be determined based on the attributes of the interface and the weight values of the attributes of the interface. In this way, the multiple API interfaces are sorted and output in order of matching degree from high to low, which is more reasonable and facilitates the user to select the most suitable interface from the multiple matched API interfaces for binding. Thus, the interface is automatically recommended according to the service network attribute and the functional feature of the first application component, which improves the binding efficiency and accuracy of the application component and the interface compared with the traditional manual searching and analysis to select the interface.
[0092] Meanwhile, based on the interface database established as described above, the API interface service across the internal and external networks is calculated according to the unified API index, and the application component is seamlessly connected with the API service across the internal and external networks through the API proxy engine.
[0093] In actual application, when the user selects the interface to be bound, the application development platform performs the operation of binding the first application component with the selected interface. After the application component is bound with the interface, it can realize the specific component function and be put into normal use.
[0094] In the above implementations, the determination of the interface is based on both the attribute of the first project and the state attribute of the first application component. However, in actual application, the interface matched with the first application component can also be determined based on only one of the attribute of the first project and the state attribute of the first application component.
[0095] For example, the attribute of the first project includes the project code and the project service area. The functional feature of the first application component can be determined by analyzing the project code of the context of the first application component, and the service network of the project, i.e., the service network of the first application component, can be determined by the project service area. Therefore, when the functional feature and the service network of the first application component are determined, the API interface that meets the requirements can be easily determined from the network.
[0096] For another example, the state attribute of the first application component includes the business attribute configured by the user and the geographic location. The functional feature of the first application component can be determined based on the business attribute, and the service network of the first application component can be determined based on the geographic location, and then the matched API interface can be selected based on the determined data. In one example, the business attribute information "reading data" is added to the first application component when it is configured, and the geographic location of the bearing device is obtained as Beijing through the positioning function of the bearing device of the first application component. Therefore, the API interface that can provide the data reading service and has the service network of China region can be determined as the matched interface based on the business attribute "reading data" and the geographic location "Beijing".
[0097] In other implementations, the state attribute of the first application component can also include running attributes of the component, such as whether testing is needed, whether networking is available, and the like. These attributes can affect the selection of the API interface. For example, for a device without networking, the first application component carried thereby can only select an API interface existing in the local network when searching for the API interface; and for a device with networking, the first application component carried thereby can search for a suitable API interface in the entire Internet when searching for the API interface.
[0098] In order to better understand the implementation of the scheme for determining an application program interface disclosed in the present application, Figure 5 An implementation flowchart for determining an application program interface is shown. In combination with Figure 5 As shown, the process for determining an application program interface can include:
[0099] 1. When a developer develops an application based on an application development platform, the developer defines in advance the service network attribute (such as an intranet, a China regional Internet, a United States regional Internet, a Japan regional Internet, and the like) of the application to be published, so as to serve as an important factor for matching an API service. The application development platform can automatically collect the attribute characteristics of the application service network. If the application service network attribute is missing, the network region in which the developer logs in to the development platform can be taken as the service network characteristics of the application.
[0100] 2. When the developer selects a dynamic API application component, the development platform automatically collects the functional characteristics (such as a data query operation, a data write operation, and the like) of the selected application component.
[0101] 3. When the developer searches for an API for the application component, the development platform, based on the API description keywords in the search request and the application component network characteristics and functional characteristics collected in steps 1 and 2, uses an API network search model to search for and calculate a list of matched API interfaces from an API classification database.
[0102] 4. The API information of several items with the highest matching degrees in step 3 is returned to an API search interactive interface for API recommendation. When the developer selects a certain API recommended, the API forms a binding relationship with the corresponding component, and the application component can call the API service through an API proxy engine.
[0103] For each method embodiment described above, in order to simply describe, the embodiments are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0104] The methods described in the above-disclosed embodiments of this application are detailed in terms of the methods. The methods of this application can be implemented by various forms of apparatus. Therefore, this application also discloses an apparatus. Specific embodiments are given below for detailed description.
[0105] Figure 6 This is a schematic diagram of the structure of an apparatus for determining an application programming interface (API) according to an embodiment of this application. See also... Figure 6 As shown, the apparatus 60 for determining the application programming interface may include:
[0106] The attribute acquisition module 601 is used to acquire the first attribute in response to the first interface search command of the first application component being triggered.
[0107] Interface determination module 602 is used to determine the matching interface based on the first attribute;
[0108] The first attribute includes: the attribute of the first item that triggered the first interface search instruction and / or the status attribute of the first application component.
[0109] The apparatus for determining the application interface described in this embodiment can determine the interface suitable for the first application component from a large number of interfaces based on the attributes of the first item that triggers the first interface search instruction and / or the state attributes of the first application component. Since there is a logical correlation between the determined interface and the first application component, the stability and accuracy of the interface selection in this application are better than that of manual interface selection.
[0110] In one implementation, the interface determination module may include: a function determination module, used to determine the functional characteristics of the first application component based on the attributes of the first project; a network determination module, used to determine the service network attributes of the first application component based on the state attributes of the first application component; and an interface determination submodule, used to determine a matching interface based on the functional characteristics and the service network attributes of the first application component.
[0111] In one implementation, the function determination module can be used to: analyze and determine the functional characteristics of the first application component based on the code information of the first project; the network determination module can be used to: determine the service network attributes of the first application component based on the address information or network usage information of the bearer device of the first application component.
[0112] In one implementation, the state attributes of the first application component include the configuration data of the bearer device and the service network attributes of the first application component. Specifically, the interface determination module can be used to: determine the interface that matches the configuration data of the bearer device based on the attributes of the first project and the state attributes of the first application component.
[0113] In one implementation, the first interface search instruction includes a keyword, and the interface determining module is specifically configured to determine an interface matching the keyword from a pre-established interface database according to the first attribute.
[0114] In one implementation, the establishment of the interface database can include: connecting the Internet interface services and the enterprise internal interface services in different network regions to the development platform of the first project; and storing the interfaces in different network regions based on business attributes to obtain an interface database available for the first application component.
[0115] In one implementation, the interface determining module is specifically configured to determine a matching interface based on an interface search model and the first attribute. The establishment of the interface search model can include: obtaining a sample data set, sample data in the sample data set including a binding relationship between an application component and an interface; determining search weights of factors based on service network regions and functional features of the application component in the sample data, the factors including the service network regions and the functional features; and constructing the interface search model based on the binding relationship and the search weights.
[0116] In one implementation, the interface determining module is configured to determine at least one matching interface according to the first attribute, and when there are at least two matching interfaces, the interface determining module can further include: a sorting output module configured to sort and output the at least two matching interfaces in descending order of matching degrees.
[0117] The apparatus for determining an application program interface in any of the above embodiments includes a processor and a memory, and the attribute obtaining module, the interface determining module, the function determining module, the network determining module, the interface determining submodule, the sorting output module, etc. in the above embodiments are all stored in the memory as program modules, and the corresponding functions are realized by the processor executing the above program modules stored in the memory.
[0118] The processor includes a core, and the core retrieves the corresponding program modules from the memory. The core can be set as one or more, and the processing of the revisit data is realized by adjusting the core parameters.
[0119] The memory can include a non-permanent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory includes at least one memory chip.
[0120] In an exemplary embodiment, a computer readable storage medium is also provided, which can be directly loaded into the internal memory of a computer and contains software codes therein, and the computer program can implement the steps of any one of the embodiments of the method for determining an application program interface after being loaded and executed by the computer.
[0121] In an exemplary embodiment, a computer program product is also provided, which can be directly loaded into the internal memory of a computer and contains software codes therein, and the computer program can implement the steps of any one of the embodiments of the method for determining an application program interface after being loaded and executed by the computer.
[0122] Further, the embodiments of the present application provide an electronic device. Figure 7 A structural schematic diagram of an electronic device disclosed by the embodiments of the present application is shown in FIG. 7. Figure 7 As shown in the figure, the electronic device comprises at least one processor 701, at least one memory 702 connected with the processor, and a bus 703; wherein the processor and the memory complete mutual communication through the bus; the processor is used to call program instructions in the memory, so as to execute the method for determining an application program interface.
[0123] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same and similar parts between the embodiments can be referred to each other. For the device disclosed by the embodiments, since it corresponds to the method disclosed by the embodiments, the description is relatively simple, and the related parts can be referred to the method part.
[0124] It should also be noted that, in this document, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.
[0125] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in random access memory (RAM), flash memory, read-only memory (ROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and
[0126] The above description of disclosed embodiments is intended to be illustrative and not restrictive. Many embodiments of the application will be apparent to those of skill in the art upon reviewing the above description. The scope of the application should, therefore, be determined not with reference to the above description, but instead should be given with reference to the appended claims, along with their full scope of equivalents.
Claims
1. A method for determining an application program interface, comprising: obtaining a first attribute in response to a first interface search instruction of a first application component being triggered; determining a matched interface according to the first attribute; wherein the first attribute comprises an attribute of a first item triggering the first interface search instruction and / or a state attribute of the first application component, the attribute of the first item comprising at least one of a project type, a project function, a project code, and a project issuing region, and the state attribute of the first application component comprising an attribute of the first application component itself and a state attribute of a carrying electronic device of the first application component. 2.The method for determining an application program interface according to claim 1, wherein the determining a matched interface according to the first attribute comprises: determining a function feature of the first application component according to the attribute of the first item; determining a service network attribute of the first application component according to the state attribute of the first application component; and determining a matched interface based on the function feature and the service network attribute of the first application component. 3.The method for determining an application program interface according to claim 2, wherein the determining a function feature of the first application component according to the attribute of the first item comprises: analyzing and determining the function feature of the first application component according to code information of the first item; and the determining a service network attribute of the first application component according to the state attribute of the first application component comprises: determining the service network attribute of the first application component according to address information or network usage information of the carrying device of the first application component. 4.The method for determining an application program interface according to claim 1, wherein the state attribute of the first application component comprises configuration data and a service network attribute of the carrying device of the first application component, and the determining a matched interface according to the first attribute comprises: determining an interface matching the configuration data of the carrying device according to the attribute of the first item and the state attribute of the first application component. 5.The method for determining an application program interface according to claim 1, wherein a keyword is included in the first interface search instruction, and the determining a matched interface according to the first attribute comprises: determining an interface matching the keyword from a pre-established interface database according to the first attribute.
6. The method of determining an application program interface according to claim 5, wherein, The establishment of the interface database comprises: communicating an internet interface service and an enterprise internal interface service of different network regions with a development platform of the first item; and storing the interfaces of different network regions based on business attributes to obtain an interface database available for the first application component. 7.The method for determining an application program interface according to claim 1, wherein the determining a matched interface according to the first attribute comprises: determining a matched interface based on an interface search model and the first attribute; and The establishment of the interface search model comprises: obtaining a sample data set, wherein sample data in the sample data set comprises a binding relationship between an application component and an interface. determining search weights of various factors based on the service network area and the function feature of the application component in the sample data, wherein the factors include the service network area and the function feature; constructing an interface search model based on the binding relationship and the search weights.
8. The method of determining an application program interface according to claim 1, wherein determining a matched interface according to the first attribute comprises: determining at least one matched interface according to the first attribute; when there are at least two matched interfaces, further comprising: ordering and outputting the at least two matched interfaces in order of the matching degree from high to low.
9. An apparatus for determining an application program interface, comprising: an attribute acquisition module configured to acquire a first attribute in response to a first interface search instruction of a first application component being triggered; an interface determination module configured to determine a matched interface according to the first attribute; wherein the first attribute includes an attribute of a first item triggering the first interface search instruction and / or a state attribute of the first application component, the attribute of the first item including at least one of a project type, a project function, a project code, and a project issuing area, and the state attribute of the first application component including an attribute of the first application component itself and a state attribute of an electronic device carrying the first application component.
10. An electronic device, comprising: a processor; a memory configured to store executable program instructions of the processor; wherein the executable program instructions include acquiring a first attribute in response to a first interface search instruction of a first application component being triggered, and determining a matched interface according to the first attribute, wherein the first attribute includes an attribute of a first item triggering the first interface search instruction and / or a state attribute of the first application component, the attribute of the first item including at least one of a project type, a project function, a project code, and a project issuing area, and the state attribute of the first application component including an attribute of the first application component itself and a state attribute of an electronic device carrying the first application component.
Citation Information
Patent Citations
Data synchronization method, device and equipment and computer readable storage medium
CN112311853A