Interface calling method, device, computer equipment and storage medium
By establishing a data protocol framework and building a data protocol template in the oracle node, the problem that the oracle node cannot effectively call third-party data sources is solved, and the work efficiency and access accuracy are improved.
Patent Information
- Application Number
- CN202211045679.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-30
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-08-30
AI Technical Summary
In the decentralized oracle system of blockchain technology, oracle nodes cannot effectively call third-party data sources due to the lack of built-in specific interface request support, resulting in low work efficiency and low access accuracy.
By establishing a data protocol framework corresponding to data parsing requirements, determining the resource positioning link template and resource access information template, building a data protocol template, and populating the resource positioning link and access information in the target access instruction into the template, generating a target interface request to invoke the target access data source.
It improves the working efficiency and access accuracy of oracle nodes, so that they can effectively call third-party data sources without paying attention to specific interface addresses and parameter information.
Smart Images

Figure CN115396483B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an interface calling method, device, computer equipment and storage medium. Background Art
[0002] With the development of computer technology, blockchain technology has emerged. In the decentralized oracle system of blockchain technology, the client application will make a request to the blockchain network to call a third-party external data source when calling a smart contract. At this time, the decentralized oracle system will monitor the application's request for the third-party data source.
[0003] In traditional technology, in order to ensure the credibility of data source acquisition, decentralized oracles cannot directly initiate requests to third-party data sources through the system itself. Therefore, a type of oracle node that can execute such request calls is required. Such oracle nodes are deployed in the servers of various organizations of the alliance chain members. However, since the oracle node does not know the specific interface of the client, there is an interface call barrier when the oracle node calls the third-party data source. For example, the client application needs to initiate a data request of "get today's temperature" to a certain weather data source. When the oracle system obtains the request and forwards the request to the oracle node, if the node does not have built-in request support for the "get today's temperature" interface, the oracle node cannot initiate an interface call request to the third-party data source, resulting in low efficiency of the oracle node and low access accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide an interface calling method, device, computer equipment, computer-readable storage medium and computer program product that can improve the working efficiency and access accuracy of oracle nodes in response to the above-mentioned technical problems.
[0005] In the first aspect, the present application provides an interface calling method. The method includes: in response to the data parsing requirements of the oracle node, establishing a data protocol framework corresponding to the data parsing requirements; determining the resource location link template corresponding to the data parsing requirements in the data protocol framework according to the data format in the data parsing requirements, and at least one resource access information template of the target access data source that the data parsing requirements need to access; constructing a data protocol template corresponding to the data parsing requirements according to the resource location link template and at least one resource access information template; filling the target resource location link and target resource access information in the target access instruction into the data protocol template to obtain the target data protocol corresponding to the target access instruction; parsing the target data protocol corresponding to the target access instruction, generating a target interface request for the target access data source that the target access instruction needs to access, and the target interface request is used to call the target access data source.
[0006] In one of the embodiments, determining the resource location link template corresponding to the data resolution requirement in the data protocol framework and at least one resource access information template of the target access data source that the data resolution requirement needs to access according to the data format in the data resolution requirement includes: comparing the data format corresponding to the data resolution requirement with the data format corresponding to each resource location link template in the resource location link template set to obtain a first comparison matching degree corresponding to each candidate resource location link template in the resource location link template set; selecting the candidate resource location link template with the maximum value of the first comparison matching degree as the resource location link template corresponding to the data resolution requirement; comparing the data format corresponding to the data resolution requirement with the data format corresponding to each resource access information template in the resource access information template set to obtain a second comparison matching degree corresponding to each candidate resource access information template in the resource access information template set; selecting each candidate resource access information template with the second comparison matching degree greater than a threshold as the resource access information template corresponding to the data resolution requirement.
[0007] In one of the embodiments, constructing a data protocol template corresponding to the data resolution requirement based on the resource location link template and at least one of the resource access information templates includes: sorting at least two of the determined resource access information templates according to the execution logic order corresponding to the data resolution requirement to obtain a sorted access information template; and combining the resource location link template and the sorted access information template based on the execution logic order corresponding to the data resolution requirement to obtain a data protocol template corresponding to the data resolution requirement.
[0008] In one of the embodiments, based on the execution logic order corresponding to the data resolution requirement, the resource location link template and the sorted access information template are combined to obtain a data protocol template corresponding to the data resolution requirement, including: according to the data resolution requirement, selecting a resource access information parameter template and a resource access configuration field template from each of the sorted access information templates; according to the execution logic order corresponding to the data resolution requirement, sorting the resource access information parameter template and the resource access configuration field template to obtain a sorted access information template; and constructing a data protocol template corresponding to the data resolution requirement based on the resource location link template and the sorted access information template.
[0009] In one of the embodiments, in response to the data parsing requirements of the oracle node, a data protocol framework corresponding to the data parsing requirements is established, including: in response to the data parsing requirements of the oracle node, the data parsing requirements are classified to obtain special data parsing sub-requirements and general data parsing sub-requirements; corresponding special data protocol sub-frameworks are constructed for each special data parsing sub-requirement, and corresponding general data protocol sub-frameworks are constructed for each general data parsing sub-requirement; at least one of the special data protocol sub-frameworks, or at least one of the general data protocol sub-frameworks, or at least one of the special data protocol sub-frameworks and at least one of the general data protocol sub-frameworks are combined to establish a data protocol framework corresponding to the data parsing requirements.
[0010] In one of the embodiments, after filling the target resource location link and target resource access information in the target access instruction into the data protocol template to obtain the target data protocol corresponding to the target access instruction, it also includes: performing data format and execution logic verification on the target resource location link in the target data protocol, each sorted target resource access information parameter in the target resource access information, and each sorted target resource access configuration field to obtain a verification result; if the verification result is failed, an error message is given, and the target resource location link and target resource access information in the target access instruction are filled into the data protocol template to obtain the target data protocol corresponding to the target access instruction.
[0011] In one of the embodiments, before the data parsing requirement of the oracle node is established, the data protocol framework corresponding to the data parsing requirement is also included: comparing the execution logic order and data format corresponding to the data parsing requirement with the execution logic order and data format corresponding to the previous data parsing requirement to obtain a data parsing requirement comparison result; obtaining the data parsing requirement difference in execution logic order and data format between the data parsing requirement and the previous data parsing requirement based on the data parsing requirement comparison result; and adjusting the previous data protocol framework based on the data parsing requirement difference to obtain a preprocessed data protocol framework.
[0012] In the second aspect, the present application also provides an interface calling device. The device includes: a data protocol framework establishment module, which is used to establish a data protocol framework corresponding to the data parsing requirement in response to the data parsing requirement of the oracle node; a resource template determination module, which is used to determine the resource location link template corresponding to the data parsing requirement in the data protocol framework according to the data format in the data parsing requirement, and at least one resource access information template of the target access data source that the data parsing requirement needs to access; a data protocol template construction module, which is used to construct a data protocol template corresponding to the data parsing requirement according to the resource location link template and at least one resource access information template; a target data protocol acquisition module, which is used to fill the target resource location link and target resource access information in the target access instruction into the data protocol template to obtain the target data protocol corresponding to the target access instruction; a target interface request generation module, which is used to parse the target data protocol corresponding to the target access instruction, and generate a target interface request for the target access instruction to access the corresponding target access data source, and the target interface request is used to call the target access data source.
[0013] In one of the embodiments, the resource template determination module is further used to compare the data format corresponding to the data resolution requirement with the data format corresponding to each resource location link template in the resource location link template set to obtain a first comparison matching degree corresponding to each candidate resource location link template in the resource location link template set; select the candidate resource location link template with the maximum value of the first comparison matching degree as the resource location link template corresponding to the data resolution requirement; compare the data format corresponding to the data resolution requirement with the data format corresponding to each resource access information template in the resource access information template set to obtain a second comparison matching degree corresponding to each candidate resource access information template in the resource access information template set; select each candidate resource access information template with the second comparison matching degree greater than a threshold as the resource access information template corresponding to the data resolution requirement.
[0014] In one of the embodiments, the data protocol template construction module is also used to sort the at least two determined resource access information templates according to the execution logic order corresponding to the data resolution requirement to obtain the sorted access information template; based on the execution logic order corresponding to the data resolution requirement, the resource location link template and the sorted access information template are combined to obtain the data protocol template corresponding to the data resolution requirement.
[0015] In one of the embodiments, the data protocol template construction module is also used to select a resource access information parameter template and a resource access configuration field template from each of the sorted access information templates according to the data analysis requirements; sort the resource access information parameter template and the resource access configuration field template according to the execution logic order corresponding to the data analysis requirements to obtain the sorted access information template; and construct a data protocol template corresponding to the data analysis requirements based on the resource location link template and the sorted access information template.
[0016] In one of the embodiments, the data protocol framework establishment module is also used to respond to the data parsing requirements of the oracle node, classify the data parsing requirements, and obtain various special data parsing sub-requirements and various general data parsing sub-requirements; construct a corresponding special data protocol sub-framework for each of the special data parsing sub-requirements, and construct a corresponding general data protocol sub-framework for each of the general data parsing sub-requirements; combine at least one of the special data protocol sub-frameworks, or at least one of the general data protocol sub-frameworks, or at least one of the special data protocol sub-frameworks and at least one of the general data protocol sub-frameworks to establish a data protocol framework corresponding to the data parsing requirements.
[0017] In one of the embodiments, the target data protocol obtaining module is also used to perform data format and execution logic verification on the target resource location link in the target data protocol, each sorted target resource access information parameter in the target resource access information, and each sorted target resource access configuration field to obtain a verification result; if the verification result is failed, an error message is given, and the target resource location link and target resource access information in the target access instruction are filled into the data protocol template to obtain the target data protocol corresponding to the target access instruction.
[0018] In one of the embodiments, the data protocol framework establishment module is also used to compare the execution logic order and data format corresponding to the data analysis requirement with the execution logic order and data format corresponding to the previous data analysis requirement, to obtain the data analysis requirement comparison result; based on the data analysis requirement comparison result, obtain the data analysis requirement difference in the execution logic order and data format between the data analysis requirement and the previous data analysis requirement; and adjust the previous data protocol framework based on the data analysis requirement difference to obtain the preprocessed data protocol framework.
[0019] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0020] In response to the data parsing requirements of the oracle node, a data protocol framework corresponding to the data parsing requirements is established; according to the data format in the data parsing requirements, a resource location link template corresponding to the data parsing requirements in the data protocol framework and at least one resource access information template of the target access data source that the data parsing requirements need to access are determined; according to the resource location link template and at least one resource access information template, a data protocol template corresponding to the data parsing requirements is constructed; the target resource location link and the target resource access information in the target access instruction are filled into the data protocol template to obtain the target data protocol corresponding to the target access instruction; the target data protocol corresponding to the target access instruction is parsed to generate a target interface request for accessing the corresponding target access data source required by the target access instruction, and the target interface request is used to call the target access data source.
[0021] In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the following steps are implemented: in response to the data parsing requirements of the oracle node, a data protocol framework corresponding to the data parsing requirements is established; according to the data format in the data parsing requirements, a resource location link template corresponding to the data parsing requirements in the data protocol framework is determined, and at least one resource access information template of the target access data source that the data parsing requirements need to access; according to the resource location link template and at least one resource access information template, a data protocol template corresponding to the data parsing requirements is constructed; the target resource location link and the target resource access information in the target access instruction are filled into the data protocol template to obtain the target data protocol corresponding to the target access instruction; the target data protocol corresponding to the target access instruction is parsed, and a target interface request for accessing the corresponding target access data source required by the target access instruction is generated, and the target interface request is used to call the target access data source.
[0022] In the fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, which implements the following steps when executed by a processor: in response to the data parsing requirements of the oracle node, establish a data protocol framework corresponding to the data parsing requirements; determine the resource location link template corresponding to the data parsing requirements in the data protocol framework according to the data format in the data parsing requirements, and at least one resource access information template of the target access data source that the data parsing requirements need to access; construct a data protocol template corresponding to the data parsing requirements according to the resource location link template and at least one resource access information template; fill the target resource location link and target resource access information in the target access instruction into the data protocol template to obtain the target data protocol corresponding to the target access instruction; parse the target data protocol corresponding to the target access instruction, and generate a target interface request for the target access data source that the target access instruction needs to access, and the target interface request is used to call the target access data source.
[0023] The above-mentioned interface calling method, apparatus, computer equipment, storage medium and computer program product establish a data protocol framework corresponding to the data resolution requirement by responding to the data resolution requirement of the oracle node; determine the resource location link template corresponding to the data resolution requirement in the data protocol framework according to the data format in the data resolution requirement, and at least one resource access information template of the target access data source that the data resolution requirement needs to access; construct a data protocol template corresponding to the data resolution requirement according to the resource location link template and at least one resource access information template; fill the target resource location link and target resource access information in the target access instruction into the data protocol template to obtain the target data protocol corresponding to the target access instruction; parse the target data protocol corresponding to the target access instruction, and generate a target interface request for the target access data source that the target access instruction needs to access, and the target interface request is used to call the target access data source.
[0024] Through the data protocol framework that can adapt to the data analysis needs, the resource location link template and resource access information template are further determined to construct the data protocol template corresponding to the data analysis needs, so as to realize the request to the third-party data source without paying attention to the specific requested interface address and parameters in the data protocol template. It can greatly reduce the need to rewrite the interface for docking every time a third-party data source needs to be added, and improve the work efficiency and access accuracy of the oracle node. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 An application environment diagram of an interface calling method in an embodiment;
[0026] Figure 2 A schematic diagram of a flow chart of an interface calling method in an embodiment;
[0027] Figure 3 A schematic diagram of a flow chart of a method for determining a resource location link template and a resource access information template in one embodiment;
[0028] Figure 4 A schematic diagram of a process for constructing a data protocol template in one embodiment;
[0029] Figure 5 A schematic diagram of a flow chart of a method for constructing a data protocol template in another embodiment;
[0030] Figure 6 A schematic diagram of a flow chart of a method for establishing a data protocol framework in one embodiment;
[0031] Figure 7 A schematic diagram of a flow chart of a method for verifying a target data protocol in one embodiment;
[0032] Figure 8 A schematic diagram of a flow chart of a method for obtaining a pre-processing data protocol framework in one embodiment;
[0033] Fig. 9 A flowchart of a method using a data protocol in Yaml format in one embodiment;
[0034] Fig.10 A structural block diagram of an interface calling device in an embodiment;
[0035] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0037] The interface calling method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown in the figure, the terminal 102 acquires data, the server 104 receives the data of the terminal 102 in response to the instruction of the terminal 102, and calculates the acquired data, and the server 104 transmits the calculation result of the data back to the terminal 102, and the terminal 102 displays it. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. In response to the data parsing requirements of the oracle node, a data protocol framework corresponding to the data parsing requirements is established; according to the data format in the data parsing requirements, a resource location link template corresponding to the data parsing requirements in the data protocol framework is determined, as well as at least one resource access information template of the target access data source that the data parsing requirements need to access; according to the resource location link template and at least one resource access information template, a data protocol template corresponding to the data parsing requirements is constructed; the target resource location link and the target resource access information in the target access instruction are filled into the data protocol template to obtain the target data protocol corresponding to the target access instruction; the target data protocol corresponding to the target access instruction is parsed to generate a target interface request for accessing the corresponding target access data source for the target access instruction, and the target interface request is used to call the target access data source. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0038] In one embodiment, Figure 2 As shown, an interface calling method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0039] Step 202, in response to the data parsing requirements of the oracle node, establish a data protocol framework corresponding to the data parsing requirements.
[0040] Among them, the oracle node can be an abstract computer node, which is used to study decision-making problems. At the same time, the oracle node can also be regarded as a Turing machine with an additional black box, the function of which is to answer specific questions within a single operation.
[0041] The data analysis requirement may be to analyze the data into a data format that can be transmitted during network communication in response to business needs.
[0042] The data protocol framework may be a template for selecting content established according to data analysis requirements, wherein the content may be fillable information such as a resource location link template and a resource access information template required by data analysis.
[0043] Specifically, corresponding to the data parsing requirements of the oracle node related to the business needs, a data protocol framework corresponding to the data parsing requirements is established in the server. Among them, data parsing can be JSON, XML, YAML, custom data format, etc. The process of JOSN data parsing is: first create a JSON file, then include document.h and cocos-ext.h header files in the class, then obtain the JSON file path through FileUtils, and parse the JSON data through the Document object, and finally obtain different types of data values. The process of XML data parsing is: first create an XML file, then include the header file in the class and use the named file, then obtain the full path of the XML file, load the XML file, and finally obtain the element and parse it. It is further believed that the establishment of the data protocol framework is to establish a template that can carry the parsed data after the above data parsing, but the template is not filled with any specific information.
[0044] For example, in response to the data parsing requirement A of the oracle node, a data protocol framework capable of carrying the parsed data after XML data parsing is established according to the data parsing requirement A for filling in specific information in the next step.
[0045] Step 204, according to the data format in the data parsing requirement, determine the resource location link template corresponding to the data parsing requirement in the data protocol framework, and at least one resource access information template of the target access data source that the data parsing requirement needs to access.
[0046] The data format may be a specific format of the data carried in the data analysis requirement, and may be, but is not limited to, data in the form of JSON, YAML, XML, custom data, etc.
[0047] The resource locator link template may be a uniform resource locator (URL) of a data source to be accessed, which is a method of indicating the location of information on the World Wide Web service program of the Internet.
[0048] The resource access information template may be a parameter template with pointing information corresponding to the data source to be accessed. By filling in the parameters in the parameter template, the accessed data source may be accurately located.
[0049] Specifically, according to the data format in the data parsing requirement, a resource location link template corresponding to the data parsing requirement is selected from a resource location link template set that matches the data protocol framework, and at least one resource access information template corresponding to the target access data source that needs to be accessed by the data parsing requirement is also selected from a resource access information template set that matches the data protocol framework, wherein the selected resource location link template and resource access information template are templates that are not filled with any specific information. Generally speaking, the selected resource location link template is a URL connection that is not filled with specific information, and the selected resource access information template is a command that is not filled with specific access parameters and specific configuration fields.
[0050] For example, according to the data format in the data analysis requirements, if a txt text is defined, the content of the text is as follows:
[0051] 1url:http: / / xxxxx.com / api / getWeather, (xxxxx is the specific URL to be entered);
[0052] 2metod:get;
[0053] 3param:location=xxx&&language=zh_cn, (xxx is the specific geographical address to be entered).
[0054] Step 206: construct a data protocol template corresponding to the data parsing requirement according to the resource location link template and at least one resource access information template.
[0055] The data protocol template may be a template obtained by determining a resource location link template from a resource location link template set and a resource access information template from a resource access information template set based on the selected data protocol framework and then filling the template into the data protocol framework.
[0056] Specifically, based on the premise of the data protocol framework determined from the data parsing requirements, a resource location link template is determined from the resource location link template set, and a resource access information template is determined from the resource access information template set and filled into the data protocol framework to obtain a filled data protocol framework. Finally, each template in the filled data protocol framework is checked according to the implementation logic of the data parsing requirements. If it is found after the check that the implementation logic of each template in the filled data protocol framework is consistent with the implementation logic of the data parsing requirements, then the data protocol template is generated.
[0057] For example, if the data protocol framework is determined to be A according to the data analysis requirements, and the resource location link template is url:http: / / xxxxx.com / api / getWeather, the resource access information template is metod:get; and param:location=xxx&&language=zh_cn, the above resource location link template and resource access information template are filled into the data protocol framework A, then the data protocol template B verified by the implementation logic of the data analysis requirements is obtained.
[0058] Step 208: fill the target resource location link and target resource access information in the target access instruction into the data protocol template to obtain the target data protocol corresponding to the target access instruction.
[0059] The target access instruction may be an instruction including data for filling in various parameters to be filled in the data protocol template, wherein the instruction mainly fills in the resource access information template and the resource location link template in the data protocol template.
[0060] The target resource access information may be one of the sub-instructions in the target access instruction. The access information has specific parameters and can fill the resource location link template in the data protocol template with the specific parameters to achieve specificization.
[0061] The target resource location link may be one of the sub-instructions in the target access instruction. The link has specific parameters and can fill the target resource access information in the data protocol template with the specific parameters to achieve specificization.
[0062] The target data protocol may be a protocol obtained by filling the target resource location link and target resource access information in the target access instruction into the data protocol template. The protocol may be a command set that can be used to access the target source after parsing.
[0063] Specifically, the target resource location link and target resource access information in the target access instruction are filled into the data protocol template according to the execution logic corresponding to the data parsing requirements, and a filled data protocol template is obtained. A check operation is performed based on the filled data protocol template. If the execution logic and the results of the check operation meet the pre-set goals, or the target data source can be accessed, the target data protocol corresponding to the target access instruction is generated.
[0064] For example, if the resource location link template in the data protocol template B is url:http: / / xxxxx.com / api / getWeather, the resource access information template is metod:get; and param:location=xxx&&language=zh_cn, and the target resource location link in the target access instruction is abcde, and the target resource access information is beijing filled in the data protocol template, then the target data protocol corresponding to the target access instruction is url:http: / / abcde.com / api / getWeather, and param:location=beijing&&language=zh_cn.
[0065] Step 210: parse the target data protocol corresponding to the target access instruction, and generate a target interface request for accessing the corresponding target access data source required by the target access instruction.
[0066] The target access data source may be an external data source that needs to be accessed in the target access instruction, and fixed parameters need to be given in order to accurately locate the data source that needs to be accessed.
[0067] Among them, the target interface request can be a universal protocol for accessing the target access data source, that is, establishing a communication protocol between the server where the oracle node is located and the server where the target data source is located.
[0068] Specifically, the oracle node combines the adapter module of the data protocol involved in the data parsing to parse the data protocol, thereby converting it into a corresponding interface request. For example, when the data protocol is passed to the oracle node, its adapter module will parse the content of the data protocol into the https protocol and initiate a request to the third-party data source.
[0069] For example, the target data protocol corresponding to the target access instruction is url:http: / / abcde.com / api / getWeather, and param:location=beijing&&language=zh_cn. By parsing the target data protocol, the target interface request for accessing the target data source can be obtained as follows:
[0070] curl GET -X https: / / api.seniverse.com / v3 / weather / now.json? key=xxxxxxxx&&locationg=Beijing.
[0071] In the above-mentioned interface calling method, by responding to the data parsing requirements of the oracle node, a data protocol framework corresponding to the data parsing requirements is established; according to the data format in the data parsing requirements, a resource location link template corresponding to the data parsing requirements in the data protocol framework and at least one resource access information template of the target access data source that the data parsing requirements need to access are determined; according to the resource location link template and at least one resource access information template, a data protocol template corresponding to the data parsing requirements is constructed; the target resource location link and the target resource access information in the target access instruction are filled into the data protocol template to obtain the target data protocol corresponding to the target access instruction; the target data protocol corresponding to the target access instruction is parsed to generate a target interface request for the target access data source that the target access instruction needs to access, and the target interface request is used to call the target access data source.
[0072] Through the data protocol framework that can adapt to the data analysis needs, the resource location link template and resource access information template are further determined to construct the data protocol template corresponding to the data analysis needs, so as to realize the request to the third-party data source without paying attention to the specific requested interface address and parameters in the data protocol template. It can greatly reduce the need to rewrite the interface for docking every time a third-party data source needs to be added, and improve the work efficiency and access accuracy of the oracle node.
[0073] In one embodiment, Figure 3 As shown, according to the data format in the data parsing requirement, determining the resource location link template corresponding to the data parsing requirement in the data protocol framework, and at least one resource access information template of the target access data source that the data parsing requirement needs to access, includes:
[0074] Step 302 : Compare the data format corresponding to the data analysis requirement with the data format corresponding to each resource location link template in the resource location link template set to obtain a first comparison matching degree corresponding to each candidate resource location link template in the resource location link template set.
[0075] The candidate resource location link templates may be a set of resource location link templates whose data formats corresponding to the data analysis requirements are compared with the data formats corresponding to the resource location link templates in the resource location link template set and whose data formats are greater than a preset threshold.
[0076] The first comparison matching degree may be a comparison of the data format corresponding to the data analysis requirement with the data format corresponding to each resource location link template in the resource location link template set, where multiple matching degrees of the corresponding data formats between the two are the first comparison matching degree.
[0077] Specifically, the data format corresponding to the data parsing requirement is compared with the data format corresponding to each resource location link template in the resource location link template set. For each comparison, a comparison matching degree is output, which is the first comparison matching degree. For all comparison results, the number of first comparison matching degrees should be less than or equal to the number of resource location link templates in the resource location link template set. If an error occurs during the comparison, the comparison result is automatically deleted. After the comparison, the first comparison matching degree corresponding to each candidate resource location link template in the resource location link template set is obtained.
[0078] For example, the data format corresponding to the data parsing requirement is JSON, and the data formats corresponding to the resource location link templates in the resource location link template set are: JSON, YAML, XML, etc. After comparing the data format corresponding to the data parsing requirement with the data format corresponding to the resource location link template in the resource location link template set, multiple comparison results are obtained, which are the first comparison matching degrees.
[0079] Step 304: Select the candidate resource location link template with the maximum first comparison matching degree as the resource location link template corresponding to the data parsing requirement.
[0080] Specifically, a candidate resource locating link template with the maximum matching degree is selected from a plurality of first comparison matching degrees obtained after comparing the data format corresponding to the data parsing requirement with the data format corresponding to each resource locating link template in the resource locating link template set as the resource locating link template corresponding to the data parsing requirement.
[0081] For example, the data format corresponding to the data parsing requirement is JSON, and the data format corresponding to each resource location link template in the resource location link template set is JSON, YAML, and XML. After comparison, three first comparison matching degrees are obtained, namely D1, D2, and D3. The candidate resource location link template corresponding to D1 with the maximum matching degree is selected as the resource location link template corresponding to the data parsing requirement.
[0082] Step 306 : Compare the data format corresponding to the data analysis requirement with the data format corresponding to each resource access information template in the resource access information template set to obtain a second comparison matching degree corresponding to each candidate resource access information template in the resource access information template set.
[0083] Among them, each candidate resource access information template may be a set formed by resource access information templates whose data format corresponding to the data parsing requirement is greater than a preset threshold after comparing the data format corresponding to each resource access information template in the resource access information template set.
[0084] The second comparison matching degree may be a comparison between the data format corresponding to the data analysis requirement and the data format corresponding to each resource access information template in the resource access information template set, and the multiple matching degrees of the corresponding data formats between the two are the second comparison matching degree.
[0085] Specifically, the data format corresponding to the data parsing requirement is compared with the data format corresponding to each resource access information template in the resource access information template set. For each comparison, a comparison matching degree will be output, which is the second comparison matching degree. For all comparison results, the number of second comparison matching degrees should be less than or equal to the number of resource access information templates in the resource access information template set. If an error occurs during the comparison, the comparison result is automatically deleted. After comparison, the second comparison matching degree corresponding to each candidate resource access information template in the resource access information template set is obtained.
[0086] For example, the data format corresponding to the data parsing requirement is JSON, and the data formats corresponding to the resource access information templates in the resource access information template set are: JSON, YAML, XML, etc. After comparing the data format corresponding to the data parsing requirement with the data format corresponding to the resource access information template in the resource access information template set, multiple comparison results are obtained, which is the second comparison matching degree.
[0087] Step 308: Select each candidate resource access information template whose second comparison matching degree is greater than a threshold as a resource access information template corresponding to the data parsing requirement.
[0088] Specifically, a candidate resource access information template having a matching degree greater than a preset threshold is selected from multiple second comparison matching degrees obtained after comparing the data format corresponding to the data parsing requirement with the data format corresponding to each resource access information template in the resource access information template set as the resource access information template corresponding to the data parsing requirement.
[0089] For example, the data format corresponding to the data parsing requirement is JSON, and the data format corresponding to each resource access information template in the resource access information template set is JSON, YAML, and XML. After comparison, three second comparison matching degrees are obtained, namely D1, D2, and D3. The candidate resource access information template corresponding to D1 with a matching degree greater than the preset threshold is selected as the resource access information template corresponding to the data parsing requirement.
[0090] In this embodiment, by calculating the first comparison matching degree between the data format corresponding to the data parsing requirement and the data format corresponding to each resource location link template in the resource location link template set, and calculating the second comparison matching degree between the data format corresponding to the data parsing requirement and the data format corresponding to each resource access information template in the resource access information template set, the most matching resource location link template and resource access information template can be selected from the resource location link template set and the resource access information template set, respectively, thereby improving the accuracy of the selected template.
[0091] In one embodiment, Figure 4 As shown, a data protocol template corresponding to the data parsing requirement is constructed according to a resource location link template and at least one resource access information template, including:
[0092] Step 402: sort the at least two determined resource access information templates according to the execution logic sequence corresponding to the data analysis requirement to obtain sorted access information templates.
[0093] The sorted access information template may be a template obtained by sorting at least two resource access information templates according to the execution logic order corresponding to the data parsing requirement.
[0094] Specifically, at least two resource access information templates that have been determined to be called are sorted from first to last according to the execution logic order corresponding to the data analysis requirements. The set composed of the resource access information templates after sorting is the sorted access information template. After the sorted access information template is generated, the sorted access information template is immediately run and checked using the execution logic order corresponding to the data analysis requirements. If any problems are found, the sorting is performed again.
[0095] For example, at least five resource access information templates are determined to be called, namely D1 to D5, and are sorted from first to last according to the execution logic order corresponding to the data analysis requirements to obtain sorted access information templates sorted as D3, D2, D4, D5, and D1.
[0096] Step 404 , based on the execution logic sequence corresponding to the data analysis requirement, the resource location link template and the sorted access information template are combined to obtain a data protocol template corresponding to the data analysis requirement.
[0097] Specifically, the resource location link template that has been determined to be called, and the sorted access information template corresponding to the sorted result determined by sorting, are combined according to the execution logic order corresponding to the data analysis requirement, wherein the sorted access information template can be one or more, and after combination, the data protocol template corresponding to the data analysis requirement is obtained. For the combined data protocol template, the data protocol template is immediately run and checked using the execution logic order corresponding to the data analysis requirement. If a problem is found, the order is re-performed.
[0098] In this embodiment, by sorting the at least two determined resource access information templates based on the execution logic order corresponding to the data analysis requirements, it can be ensured that the sorted access information templates have no logical problems, thereby improving the work efficiency of the system.
[0099] In one embodiment, Figure 5 As shown, based on the execution logic order corresponding to the data analysis requirements, the resource location link template and the sorted access information template are combined to obtain a data protocol template corresponding to the data analysis requirements, including:
[0100] Step 502: Select a resource access information parameter template and a resource access configuration field template from the sorted access information templates according to data analysis requirements.
[0101] The resource access information parameter template may be a sub-template constituting the sorted access information template, and there may be at least one resource access information parameter template for any sorted access information template.
[0102] The resource access configuration field template may be a sub-template constituting the sorted access information template, and there may be at least one resource access configuration field template for any sorted access information template.
[0103] Specifically, according to the data analysis requirements, the content templates are extracted from each sorted access information template, which are the resource access information parameter template and the resource access configuration field template. For any sorted access information template, it contains a resource access information parameter template and a resource access configuration field template, and the number is at least one, and in most cases, multiple. No selection is made during extraction, and all resource access information parameter templates and resource access configuration field templates in the sorted access information template are extracted respectively.
[0104] For example, according to data analysis requirements, the resource access information parameter templates and resource access configuration field templates are extracted from the sorted access information templates 1-10 respectively, and no selection is made during the extraction. All resource access information parameter templates and resource access configuration field templates in the sorted access information templates 1-10 are extracted respectively.
[0105] Step 504, sorting the resource access information parameter template and the resource access configuration field template according to the execution logic sequence corresponding to the data analysis requirement to obtain a sorted access information template.
[0106] The sorted access information template may be an information template obtained by sorting the resource access information parameter template and the resource access configuration field template in the sorted access information template according to the execution logic sequence corresponding to the data analysis requirement.
[0107] Specifically, the resource access information parameter templates and resource access configuration field templates extracted from each sorted access information template are sorted separately and correspondingly according to the execution logic order corresponding to the data analysis requirements, and the sorted access information template corresponding to each sorted access information template is obtained. Among them, when sorting, the resource access information parameter template and the resource access configuration field template can be sorted separately, or the two can be sorted together. Among them, the sorted access information template needs to use the execution logic order corresponding to the data analysis requirements to verify the operation process of the data protocol template.
[0108] For example, all resource access information parameter templates 1-5 and resource access configuration field templates 6-10 in each sorted access information template 1-10 are extracted respectively, and then the sorted access information template corresponding to each sorted access information template is obtained according to the execution logic order corresponding to the data analysis requirements.
[0109] Step 506: construct a data protocol template corresponding to the data analysis requirement based on the resource location link template and the sorted access information template.
[0110] Specifically, based on the sorted and verified access information template, combined with the resource location link template, and combined according to the execution logic sequence corresponding to the data analysis requirements, the data protocol template corresponding to the data analysis requirements can be constructed. Among them, the construction of the data protocol template requires the use of the execution logic sequence corresponding to the data analysis requirements to verify the operation process of the data protocol template.
[0111] For example, based on the sorted and verified sorted access information templates 1-10, combined with the resource location link template, they are combined in the execution logic order corresponding to the data analysis requirements to obtain the data protocol templates corresponding to the data analysis requirements and the sorted sorted access information templates 1-10.
[0112] In this embodiment, by sorting multiple resource access information parameter templates and multiple resource access configuration field templates in the sorted access information template according to data analysis requirements, the execution logic and execution plan in the data protocol template can be further refined, and errors in constructing the data protocol template can be reduced, thereby improving the accuracy of system operation.
[0113] In one embodiment, Figure 6 As shown, in response to the data parsing requirements of the oracle node, a data protocol framework corresponding to the data parsing requirements is established, including:
[0114] Step 602, in response to the data analysis requirements of the oracle node, classify the data analysis requirements to obtain various special data analysis sub-requirements and various general data analysis sub-requirements.
[0115] The special data analysis sub-demand may be a demand that requires a template corresponding to a special data format to be processed.
[0116] The general data analysis sub-demand may be a demand that requires a template corresponding to a general data format to be processed.
[0117] Specifically, in response to the data parsing requirements of the oracle node, the data parsing requirements are split to obtain multiple data parsing sub-requirements. According to the data format of the data parsing sub-requirements, each data parsing sub-requirement is classified into special data parsing sub-requirements (special data format) and general data parsing sub-requirements (general data format).
[0118] For example, corresponding to the data parsing requirements of the oracle node, the data parsing requirements are split, and the three data parsing sub-requirements that require special data formats, namely JSON, YAML, and XML, are classified into special data parsing sub-requirements, and the data parsing sub-requirements that do not have any data format requirements are classified into general data parsing sub-requirements.
[0119] Step 604: construct a corresponding special data protocol subframe for each special data parsing sub-requirement, and construct a corresponding general data protocol subframe for each general data parsing sub-requirement.
[0120] Among them, the special data protocol subframe can be constructed corresponding to the special data parsing sub-requirements in the data parsing requirements of the oracle node, and is used to parse the framework with a special data format after filling in the corresponding parameters.
[0121] Among them, the universal data protocol subframe can be constructed according to the universal data parsing sub-requirements in the data parsing requirements of the oracle node, and is used to parse the framework with a universal data format after filling in the corresponding parameters.
[0122] Specifically, in response to the special data parsing sub-requirements corresponding to the data parsing requirements of the oracle node, a special data protocol sub-framework capable of parsing the various data formats is constructed according to the data formats of the special data parsing sub-requirements; similarly, a general data protocol sub-framework capable of parsing the various data formats is constructed according to the data formats of the general data parsing sub-requirements.
[0123] For example, in response to the data parsing requirements of the oracle node, special data protocol subframeworks 1-5 are respectively constructed for the data parsing sub-requirements 1-5 classified as special data parsing sub-requirements; similarly, general data protocol subframeworks 11-15 are respectively constructed for the data parsing sub-requirements 11-15 classified as general data parsing sub-requirements.
[0124] Step 606: Combine at least one special data protocol subframe, or at least one general data protocol subframe, or at least one special data protocol subframe and at least one general data protocol subframe to establish a data protocol framework corresponding to the data parsing requirement.
[0125] Specifically, in response to the data parsing requirements of the oracle node, at least one special data protocol subframe, or at least one general data protocol subframe, or at least one special data protocol subframe and at least one general data protocol subframe are selected for combination, and the combination process also requires sorting the selected data protocol subframes, and finally obtains the data protocol framework corresponding to the data parsing requirements. For the established data protocol framework, it is necessary to use the execution logic sequence corresponding to the data parsing requirements to check its running process, and if an error occurs, it is recombined and sorted.
[0126] In this embodiment, the data parsing sub-demands are classified based on the data parsing requirements of the oracle node, and the corresponding data protocol sub-framework is constructed according to the classification. When the data protocol framework is constructed, the corresponding sub-framework can be accurately and appropriately extracted according to the data format of the data parsing requirements, thereby reducing errors in constructing the data protocol framework and improving the stability of system operation.
[0127] In one embodiment, Figure 7As shown, after the target resource location link and the target resource access information in the target access instruction are filled into the data protocol template and the target data protocol corresponding to the target access instruction is obtained, it also includes:
[0128] Step 702, verify the data format and execution logic of the target resource location link in the target data protocol, each sorted target resource access information parameter in the target resource access information, and each sorted target resource access configuration field to obtain a verification result.
[0129] Specifically, after the target resource location link and target resource access information in the target access instruction are filled into the data protocol template, the data format of each target resource location link, the sorted target resource access information parameter, and the sorted target resource access configuration field of the generated target data protocol is verified. If the verification passes, the overall execution logic of the target data protocol is checked according to the execution logic sequence corresponding to the data parsing requirements to obtain the verification result. If one of the above two verifications fails, the verification result is failed.
[0130] For example, after the target resource location link and target resource access information in the target access instruction are filled into the data protocol template, the data format of each target resource location link, the sorted target resource access information parameters and the sorted target resource access configuration fields of the generated target data protocol are verified, and then the overall execution logic of the target data protocol is checked. If both data format verification 1 and execution logic check 2 pass, the verification passes; if either data format verification 1 or execution logic check 2 fails, the verification fails.
[0131] Step 704: If the verification result is not passed, an error message is given, and the target resource location link and target resource access information in the target access instruction are returned to fill in the data protocol template to obtain the target data protocol corresponding to the target access instruction.
[0132] Specifically, if the verification result is not passed, an error message is displayed, and the error location is displayed to the visualization system. The target resource location link and target resource access information in the target access instruction are filled into the data protocol template to obtain the target data protocol corresponding to the target access instruction.
[0133] For example, if the verification result is failed, an error message will be displayed, and the location where the error occurred will be displayed on the main screen of the control center, and the previous step will be re-executed.
[0134] In this embodiment, by verifying the data format and execution logic of the target resource location link, the sorted target resource access information parameters, and the sorted target resource access configuration fields, the assigned target data protocol can be further checked to avoid the inability to accurately compile the corresponding interface when the target data protocol is subsequently compiled, thereby improving the accuracy of the system operation.
[0135] In one embodiment, Figure 8 As shown, in response to the data parsing requirements of the oracle node, before establishing the data protocol framework corresponding to the data parsing requirements, it also includes:
[0136] Step 802 , respectively compare the execution logic sequence and data format corresponding to the data analysis requirement with the execution logic sequence and data format corresponding to the previous data analysis requirement to obtain a data analysis requirement comparison result.
[0137] The data analysis requirement comparison result may be a numerical value obtained by comparing two different data analysis requirements and used to represent the same degree.
[0138] Specifically, the previous data analysis requirement is retrieved from the storage unit, and the corresponding execution logic sequence and data format are obtained. The execution logic sequence and data format of the previous data analysis requirement are compared with the execution logic sequence and data format of the current data analysis requirement to obtain the data analysis requirement comparison result.
[0139] Step 804, based on the data analysis requirement comparison result, obtain the data analysis requirement difference between the data analysis requirement and the previous data analysis requirement in terms of execution logic order and data format; and adjust the previous data protocol framework based on the data analysis requirement difference to obtain the preprocessed data protocol framework.
[0140] The data parsing requirement difference may be the difference in execution logic and data format between a previous data parsing requirement and a current data parsing requirement.
[0141] The pre-processed data protocol framework may be a data protocol framework obtained by adjusting a previous data protocol framework according to current data analysis requirements.
[0142] Specifically, based on the data resolution requirement comparison result after comparing the execution logical order and data format corresponding to the data resolution requirement with the execution logical order and data format corresponding to the previous data resolution requirement, the differences in execution logical order and data format between the data resolution requirement and the previous data resolution requirement are extracted to obtain the data resolution requirement difference; and further based on the data resolution requirement difference, the previous data protocol framework is compared to obtain a preprocessing data protocol framework applied to the current data resolution requirement.
[0143] In this embodiment, the execution logic order and data format of the current data parsing requirement are compared with the previous data parsing requirement, and the previous data protocol framework is modified based on the differences between the comparison results to obtain a preprocessed data protocol framework that can adapt to the current data parsing requirement, which can reduce the computer's computing power and improve the system's work efficiency.
[0144] In one embodiment, if the text content of txt is converted into an http request, it is not limited to being converted into a request of the http protocol, but can also be converted into requests of various different protocols such as RPC. Since the incoming fixed format data needs to contain the necessary parameters required by each protocol, the oracle node will convert it into a request of the corresponding protocol according to the incoming parameters.
[0145] In one embodiment, for calling different protocols, it is only necessary to assemble the corresponding parameters. For example, if the content of this yaml is converted into a HTTP protocol call, then the yaml format defines the url, method, params and other contents, which are all irrelevant to the business. When calling the interface for obtaining data normally through the http protocol, it is necessary to know the url, method, and parameter set of the interface that need to be passed in. Then when using the http protocol to call an interface such as obtaining flight information, it is also necessary to know the url, method, and parameter set of the interface that need to be passed in when calling the interface. Therefore, the present invention actually only needs a set of fixed-format data protocols (the purpose is to let the oracle node know how to obtain parameters such as url, method, params, etc.), which can be converted into calls to protocols such as HTTP protocol, RPC protocol, GRPC, etc. through the oracle node.
[0146] For example, when calling the detailed information interface of a specified flight, the flight number and date, that is, the flightNo and date parameters, need to be passed in. Then the URL in the figure needs to be changed to the URL for obtaining flight information: http: / / api.flight.com / getFlightInfo, where method is get, and params requires the client to pass in the flight number and date content: flightNo: KN3415; date: 2022 / 06 / 09, which is converted into the http protocol into a request similar to the following: http: / / api.flight.com / getFlightInfo? flightNo=KN3415&&date=2022 / 06 / 09.
[0147] In one embodiment, Fig. 9 The data format in the example is converted into the http protocol to use the following link to initiate a call to the third-party data source:
[0148] http: / / api.seniverse.com / v3 / weather / now.json?key={{SYS_MOJI_API_KEY}}&location={{location}}&language={{language}}&&unit={{unit}}
[0149] The fields in double brackets are variable values passed in by the client. After replacing the variable values into the above-mentioned http protocol, a normal call can be initiated to the third-party data source.
[0150] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0151] Based on the same inventive concept, the embodiment of the present application also provides an interface calling device for implementing the interface calling method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more interface calling device embodiments provided below can refer to the limitations on the interface calling method above, and will not be repeated here.
[0152] In one embodiment, Fig.10 As shown, an interface calling device is provided, including: a data protocol framework establishing module 1002, a resource template determining module 1004, a data protocol template constructing module 1006, a target data protocol obtaining module 1008 and a target interface request generating module 1010, wherein:
[0153] A data protocol framework establishing module 1002 is used to establish a data protocol framework corresponding to the data analysis requirements in response to the data analysis requirements of the oracle node;
[0154] The resource template determination module 1004 is used to determine, according to the data format in the data parsing requirement, a resource location link template corresponding to the data parsing requirement in the data protocol framework, and at least one resource access information template of a target access data source that needs to be accessed by the data parsing requirement;
[0155] A data protocol template construction module 1006, configured to construct a data protocol template corresponding to the data parsing requirement according to the resource location link template and at least one resource access information template;
[0156] The target data protocol obtaining module 1008 is used to fill the target resource location link and the target resource access information in the target access instruction into the data protocol template to obtain the target data protocol corresponding to the target access instruction;
[0157] The target interface request generation module 1010 is used to parse the target data protocol corresponding to the target access instruction, and generate a target interface request for accessing the corresponding target access data source required by the target access instruction. The target interface request is used to call the target access data source.
[0158] In one of the embodiments, the resource template determination module 1004 is further used to compare the data format corresponding to the data resolution requirement with the data format corresponding to each resource location link template in the resource location link template set to obtain a first comparison matching degree corresponding to each candidate resource location link template in the resource location link template set; select the candidate resource location link template with the maximum first comparison matching degree as the resource location link template corresponding to the data resolution requirement; compare the data format corresponding to the data resolution requirement with the data format corresponding to each resource access information template in the resource access information template set to obtain a second comparison matching degree corresponding to each candidate resource access information template in the resource access information template set; select each candidate resource access information template with a second comparison matching degree greater than a threshold as the resource access information template corresponding to the data resolution requirement.
[0159] In one of the embodiments, the data protocol template construction module 1006 is also used to sort at least two determined resource access information templates according to the execution logic order corresponding to the data resolution requirement to obtain a sorted access information template; based on the execution logic order corresponding to the data resolution requirement, the resource location link template and the sorted access information template are combined to obtain a data protocol template corresponding to the data resolution requirement.
[0160] In one of the embodiments, the data protocol template construction module 1006 is also used to select a resource access information parameter template and a resource access configuration field template from each sorted access information template according to data analysis requirements; sort the resource access information parameter template and the resource access configuration field template according to the execution logic order corresponding to the data analysis requirements to obtain the sorted access information template; and construct a data protocol template corresponding to the data analysis requirements based on the resource location link template and the sorted access information template.
[0161] In one embodiment, the data protocol framework establishing module 1002 is also used to respond to the data parsing requirements of the oracle node, classify the data parsing requirements, and obtain various special data parsing sub-requirements and various general data parsing sub-requirements; construct a corresponding special data protocol sub-framework for each special data parsing sub-requirement, and construct a corresponding general data protocol sub-framework for each general data parsing sub-requirement; combine at least one special data protocol subframework, or at least one general data protocol subframework, or at least one special data protocol subframework and at least one general data protocol subframework to establish a data protocol framework corresponding to the data parsing requirements.
[0162] In one of the embodiments, the target data protocol obtaining module 1008 is also used to perform data format and execution logic verification on the target resource location link in the target data protocol, each sorted target resource access information parameter in the target resource access information, and each sorted target resource access configuration field to obtain a verification result; if the verification result is failed, an error message is given, and the target resource location link and target resource access information in the target access instruction are returned to fill into the data protocol template to obtain the target data protocol corresponding to the target access instruction.
[0163] In one of the embodiments, the data protocol framework establishing module 1002 is also used to compare the execution logic order and data format corresponding to the data parsing requirement with the execution logic order and data format corresponding to the previous data parsing requirement, to obtain the data parsing requirement comparison result; based on the data parsing requirement comparison result, obtain the data parsing requirement difference in the execution logic order and data format between the data parsing requirement and the previous data parsing requirement; and adjust the previous data protocol framework based on the data parsing requirement difference to obtain the preprocessed data protocol framework.
[0164] Each module in the above interface calling device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0165] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store server data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an interface calling method is implemented.
[0166] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0167] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0168] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0169] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from a computer-readable storage medium, and the processor executes the computer instructions so that the computer device performs the steps in the above-mentioned method embodiments. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0170] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0171] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0172] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An interface calling method, characterized in that: The method comprises: In response to the data analysis requirements of the oracle node, a data protocol framework corresponding to the data analysis requirements is established; According to the data format in the data parsing requirement, determine the resource location link template corresponding to the data parsing requirement in the data protocol framework, and at least one resource access information template of the target access data source that the data parsing requirement needs to access; Constructing a data protocol template corresponding to the data parsing requirement according to the resource location link template and at least one of the resource access information templates; Fill the target resource location link and target resource access information in the target access instruction into the data protocol template to obtain the target data protocol corresponding to the target access instruction; Parsing the target data protocol corresponding to the target access instruction, generating a target interface request for accessing the corresponding target access data source required by the target access instruction, wherein the target interface request is used to call the target access data source; The step of responding to the data parsing requirements of the oracle node and establishing a data protocol framework corresponding to the data parsing requirements includes: In response to the data analysis requirements of the oracle node, the data analysis requirements are classified to obtain special data analysis sub-requirements and general data analysis sub-requirements; Constructing a corresponding special data protocol subframe for each of the special data parsing sub-requirements, and constructing a corresponding general data protocol subframe for each of the general data parsing sub-requirements; Combine at least two of the special data protocol subframes, or at least two of the general data protocol subframes, or at least one of the special data protocol subframes and at least one of the general data protocol subframes to establish a data protocol frame corresponding to the data parsing requirement; The constructing of a data protocol template corresponding to the data analysis requirement includes: Filling the resource location link template corresponding to the data parsing requirement and the at least one resource access information template into the data protocol frame to obtain a filled data protocol frame; When the implementation logic of each template in the populated data protocol framework is consistent with the implementation logic of the data parsing requirement, a data protocol template is generated.
2. The method according to claim 1, characterized in that The method of determining, according to the data format in the data parsing requirement, a resource location link template corresponding to the data parsing requirement in the data protocol framework, and at least one resource access information template of a target access data source that needs to be accessed by the data parsing requirement, includes: Comparing the data format corresponding to the data parsing requirement with the data format corresponding to each of the resource locating link templates in the resource locating link template set, to obtain a first comparison matching degree corresponding to each candidate resource locating link template in the resource locating link template set; Selecting the candidate resource location link template with the maximum first comparison matching degree as the resource location link template corresponding to the data parsing requirement; Comparing the data format corresponding to the data parsing requirement with the data format corresponding to each of the resource access information templates in the resource access information template set, to obtain a second comparison matching degree corresponding to each candidate resource access information template in the resource access information template set; Each of the candidate resource access information templates whose second comparison matching degree is greater than a threshold is selected as the resource access information template corresponding to the data parsing requirement.
3. The method according to claim 1, characterized in that The step of constructing a data protocol template corresponding to the data parsing requirement according to the resource location link template and at least one of the resource access information templates includes: Sorting the at least two resource access information templates that have been determined according to the execution logic order corresponding to the data analysis requirements to obtain sorted access information templates; Based on the execution logic order corresponding to the data analysis requirement, the resource location link template and the sorted access information template are combined to obtain a data protocol template corresponding to the data analysis requirement.
4. The method according to claim 3, characterized in that: The step of combining the resource location link template and the sorted access information template based on the execution logic sequence corresponding to the data parsing requirement to obtain a data protocol template corresponding to the data parsing requirement includes: According to the data analysis requirements, a resource access information parameter template and a resource access configuration field template are selected from each of the sorted access information templates; According to the execution logic order corresponding to the data analysis requirements, the resource access information parameter template and the resource access configuration field template are sorted to obtain a sorted access information template; Based on the resource location link template and the sorted access information template, a data protocol template corresponding to the data parsing requirement is constructed.
5. The method according to claim 1, characterized in that After the target resource location link and the target resource access information in the target access instruction are filled into the data protocol template to obtain the target data protocol corresponding to the target access instruction, the method further includes: Performing data format and execution logic verification on the target resource location link in the target data protocol, each sorted target resource access information parameter in the target resource access information, and each sorted target resource access configuration field to obtain a verification result; If the verification result is not passed, an error message is given, and the target resource location link and target resource access information in the target access instruction are filled into the data protocol template to obtain the target data protocol corresponding to the target access instruction.
6. The method according to claim 1, characterized in that Before the data protocol framework corresponding to the data parsing requirement is established in response to the data parsing requirement of the oracle node, the method further includes: Compare the execution logic sequence and data format corresponding to the data analysis requirement with the execution logic sequence and data format corresponding to the previous data analysis requirement to obtain a data analysis requirement comparison result; According to the comparison result of the data analysis requirements, the data analysis requirements difference in execution logic order and data format between the data analysis requirements and the previous data analysis requirements is obtained; and according to the data analysis requirements difference, the previous data protocol framework is adjusted to obtain the preprocessing data protocol framework.
7. An interface calling device, characterized in that: The device comprises: A data protocol framework establishment module, used to respond to the data analysis requirements of the oracle node and establish a data protocol framework corresponding to the data analysis requirements; A resource template determination module, used to determine, according to the data format in the data parsing requirement, a resource location link template corresponding to the data parsing requirement in the data protocol framework, and at least one resource access information template of a target access data source that needs to be accessed by the data parsing requirement; A data protocol template construction module, used to construct a data protocol template corresponding to the data parsing requirement according to the resource location link template and at least one of the resource access information templates; A target data protocol obtaining module, used to fill the target resource location link and target resource access information in the target access instruction into the data protocol template to obtain the target data protocol corresponding to the target access instruction; A target interface request generation module, used to parse the target data protocol corresponding to the target access instruction, and generate a target interface request for accessing the corresponding target access data source required by the target access instruction, wherein the target interface request is used to call the target access data source; The step of responding to the data parsing requirements of the oracle node and establishing a data protocol framework corresponding to the data parsing requirements includes: In response to the data analysis requirements of the oracle node, the data analysis requirements are classified to obtain special data analysis sub-requirements and general data analysis sub-requirements; Constructing a corresponding special data protocol subframe for each of the special data parsing sub-requirements, and constructing a corresponding general data protocol subframe for each of the general data parsing sub-requirements; Combine at least two of the special data protocol subframes, or at least two of the general data protocol subframes, or at least one of the special data protocol subframes and at least one of the general data protocol subframes to establish a data protocol frame corresponding to the data parsing requirement; The constructing of a data protocol template corresponding to the data analysis requirement includes: Filling the resource location link template corresponding to the data parsing requirement and the at least one resource access information template into the data protocol frame to obtain a filled data protocol frame; When the implementation logic of each template in the populated data protocol framework is consistent with the implementation logic of the data parsing requirement, a data protocol template is generated.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Oracle data processing method and centralized oracle module
CN114143333A