Call chain generation methods, devices, electronic devices, and storage media

By assigning private keys to capability APIs and using blockchain to generate call chains, the problem of call information errors in microservice architecture is solved, achieving traceability and security, and reducing the risk of network attacks.

CN116248318BActive Publication Date: 2026-11-10CHINA TELECOM CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211569728.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-08
Publication Date
2026-11-10
Estimated Expiration
2042-12-08

AI Technical Summary

Technical Problem

In a microservice architecture, errors in call information are difficult to trace, increasing the risk of network attacks and making it impossible to quickly locate faulty microservices, thus affecting the reliability and security of business scenarios.

Method used

By assigning private keys to capability APIs for authentication and generating capability call chains based on blockchain technology to record call information, traceability and immutability are achieved.

Benefits of technology

It achieves traceability and immutability of capability invocation, reduces the risk of network attacks, and improves fault location efficiency and system security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116248318B_ABST
    Figure CN116248318B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, electronic device, and storage medium for generating a call chain. The method includes: in response to an application calling a target business scenario, obtaining a target capability API (Application Programming Interface) for the capability being called in the target business scenario; obtaining a private key for the target capability API; authenticating the private key for the target capability API to obtain an authentication result; and, in response to the authentication result indicating successful authentication of the private key for the target capability API, generating a capability call chain corresponding to the target business scenario based on the call information of the called capability and the target capability API. This application embodiment can achieve traceability and immutability of capability calls, fundamentally solving the problem of errors in call information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, electronic device, and storage medium for generating call chains. Background Technology

[0002] With the advancement of digital transformation, many enterprises are undertaking comprehensive cloud-based transformations of their digital platforms and cloud-native upgrades to related systems. The industry has proposed implementing a unified API (Application Programming Interface) service interface based on a microservice architecture and building a unified capability open operation platform. This platform serves both capability providers and users, enabling unified registration, monitoring, and call management of capabilities. This microservice-based capability open operation platform achieves flexible capability expansion and reusability, accelerating application deployment to some extent.

[0003] However, with the increasing number of capability providers and users, the capabilities integrated into the capability open operation platform are also expanding. Upper-layer application systems (such as CRM (Customer Relationship Management) systems, marketing systems, billing systems, monitoring systems, etc.) implementing a complete business scenario often require multiple systems providing multiple independently running microservices. The call relationships between capabilities are a black box to the upper-layer business scenario. When a failure occurs during a business scenario call, it is often impossible to quickly locate the specific microservice capability that failed. Furthermore, due to the cross-system and cross-platform capability access involved, there are many entry points between microservice-based applications, which may lead to errors in call information. This also increases the attack surface and the risk of network attacks, placing higher demands on capability security on both the capability supply and demand sides, as well as on the capability open platform. Summary of the Invention

[0004] The technical problem to be solved by the embodiments of this application is to provide a method, apparatus, electronic device and storage medium for generating a call chain, so as to achieve the traceability and immutability of capability calls, and fundamentally solve the problem of errors in call information.

[0005] In a first aspect, embodiments of this application provide a method for generating a call chain, the method comprising:

[0006] In response to an application calling a target business scenario, obtain the target capability API (Application Programming Interface) of the capability called in the target business scenario;

[0007] Obtain the target capability API private key;

[0008] Authenticate the private key of the target capability API to obtain the authentication result;

[0009] In response to the authentication result indicating that the private key of the target capability API has been successfully authenticated, a capability call chain corresponding to the target business scenario is generated based on the call information of the called capability and the target capability API.

[0010] Optionally, before obtaining the target capability API that is invoked in the target business scenario, the method further includes:

[0011] In response to newly launched business scenarios, obtain the corresponding capability provider under the business scenario and the capabilities invoked by the capability provider;

[0012] Configure the capability provider identifier corresponding to the capability provider, and the capability API identifier, capability API public key, and capability API private key corresponding to the capability;

[0013] Establish the association between the business scenario, the capability provider identifier, the capability API identifier, the capability API public key, and the capability API private key.

[0014] Optionally, obtaining the target capability API for the capability invoked in the target business scenario includes:

[0015] Based on the aforementioned relationship, obtain the target capability provider identifier and the target capability API identifier corresponding to the target business scenario;

[0016] Based on the target capability provider identifier and the target capability API identifier, the target capability API for the capability to be invoked in the target business scenario is determined.

[0017] Optionally, the authentication of the target capability API private key to obtain the authentication result includes:

[0018] Retrieve the pre-saved API public key;

[0019] The public key of the capability API is matched one by one with the private key of the target capability API to obtain the matching result;

[0020] Based on the matching results, the authentication result of the target capability API private key is determined.

[0021] Optionally, after authenticating the private key of the target capability API and obtaining the authentication result, the method further includes:

[0022] In response to the authentication result indicating that the authentication of the target capability API private key failed, a capability call data packet is generated based on the call log information corresponding to the target business scenario;

[0023] The capability call data packet is uploaded to the private blockchain corresponding to the target business scenario.

[0024] Optionally, generating the capability call chain corresponding to the target business scenario based on the call information of the called capability and the target capability API includes:

[0025] Obtain the call time, call request information, target capability API identifier, and call data information corresponding to the target capability API;

[0026] The call time, the call request information, the target capability API identifier, and the call data information are encrypted using a preset hash algorithm to generate encrypted capability call information, and the encrypted capability call information is uploaded to the private blockchain corresponding to the target business scenario.

[0027] In response to the completion of the target business scenario call operation, the capability call chain is generated based on the encrypted capability call information of all the private blockchains.

[0028] Secondly, embodiments of this application provide a call chain generation apparatus, the apparatus comprising:

[0029] The target capability API acquisition module is used to acquire the target capability API (application programming interface) of the capability called in the target business scenario in response to the application calling the target business scenario.

[0030] The target API private key acquisition module is used to acquire the target capability API private key of the target capability API;

[0031] The authentication result acquisition module is used to authenticate the private key of the target capability API and obtain the authentication result;

[0032] The capability call chain generation module is used to generate a capability call chain corresponding to the target business scenario based on the call information of the called capability and the target capability API, in response to the authentication result indicating that the private key of the target capability API has been successfully authenticated.

[0033] Optionally, the device further includes:

[0034] The capability acquisition module is invoked in response to newly launched business scenarios to obtain the corresponding capability providers and the capabilities invoked by the capability providers under the business scenarios.

[0035] The capability information configuration module is used to configure the capability provider identifier corresponding to the capability provider, and the capability API identifier, capability API public key and capability API private key corresponding to the capability;

[0036] The association establishment module is used to establish the association between the business scenario, the capability provider identifier, the capability API identifier, the capability API public key, and the capability API private key.

[0037] Optionally, the target capability API acquisition module includes:

[0038] The target API identifier acquisition unit is used to acquire the target capability provider identifier and the target capability API identifier corresponding to the target business scenario based on the association relationship.

[0039] The target capability API determination unit is used to determine the target capability API of the capability to be invoked in the target business scenario based on the target capability provider identifier and the target capability API identifier.

[0040] Optionally, the authentication result acquisition module includes:

[0041] The Capability API Public Key Acquisition Unit is used to obtain pre-saved capability API public keys.

[0042] The matching result acquisition unit is used to match the capability API public key with the target capability API private key one by one to obtain the matching result;

[0043] The authentication result determination unit is used to determine the authentication result of the target capability API private key based on the matching result.

[0044] Optionally, the device further includes:

[0045] The capability data packet generation module is used to generate a capability call data packet based on the call log information corresponding to the target capability API private key authentication failure in response to the authentication result indicating that the authentication of the target capability API private key has failed.

[0046] The capability data packet upload module is used to upload the capability call data packet to the private blockchain corresponding to the target business scenario.

[0047] Optionally, the capability call chain generation module includes:

[0048] The call information acquisition unit is used to acquire the call time, call request information, target capability API identifier and call data information corresponding to the target capability API;

[0049] The encrypted call information generation unit is used to encrypt the call time, the call request information, the target capability API identifier and the call data information based on a preset hash algorithm, generate encrypted capability call information, and upload the encrypted capability call information to the private blockchain corresponding to the target business scenario;

[0050] The capability call chain generation unit is used to generate the capability call chain based on the encrypted capability call information of all the private blockchains in response to the completion of the target business scenario call operation.

[0051] Thirdly, embodiments of this application provide an electronic device, including:

[0052] A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the call chain generation method described in any of the preceding claims.

[0053] Fourthly, embodiments of this application provide a computer-readable storage medium that, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the call chain generation method described in any of the preceding claims.

[0054] Compared with the prior art, the embodiments of this application have the following advantages:

[0055] In this embodiment, in response to an application calling a target business scenario, the target capability API (Application Programming Interface) of the capability to be called in the target business scenario is obtained. The private key of the target capability API is obtained. The private key is authenticated, and an authentication result is obtained. In response to the authentication result indicating successful authentication of the private key, a capability call chain corresponding to the target business scenario is generated based on the call information of the called capability and the target capability API. This embodiment, by assigning a corresponding private key to the capability API, authenticates the private key of the capability API when it is called in a business scenario, and generates a capability call chain corresponding to the target business scenario based on the call information of the called capability and the capability API, thereby achieving traceability and immutability of capability calls, fundamentally solving the problem of errors in call information.

[0056] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0057] Figure 1 A flowchart illustrating the steps of a call chain generation method provided in this application embodiment;

[0058] Figure 2A schematic diagram of a design-state framework provided in an embodiment of this application;

[0059] Figure 3 A schematic diagram of a runtime framework provided in an embodiment of this application;

[0060] Figure 4 A schematic diagram illustrating the distribution of blockchain nodes provided in an embodiment of this application;

[0061] Figure 5 A schematic diagram of a capability invocation chain provided for an embodiment of this application;

[0062] Figure 6 A schematic diagram illustrating a capability invocation provided in an embodiment of this application;

[0063] Figure 7 This is a schematic diagram of the structure of a call chain generation device provided in an embodiment of this application;

[0064] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0065] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0066] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0067] Reference Figure 1 The flowchart illustrates the steps of a call chain generation method provided in an embodiment of this application, as follows: Figure 1 As shown, the call chain generation method may include the following steps:

[0068] Step 101: In response to the application calling the target business scenario, obtain the target capability API (Application Programming Interface) of the capability called in the target business scenario.

[0069] The embodiments of this application can be applied to a blockchain management platform, that is, the executing entity is the blockchain management platform.

[0070] A blockchain platform can include several capability centers (i.e., capability providers) and the capabilities provided by each capability center. For example... Figure 4As shown, the blockchain (i.e., the blockchain management platform) has registered product center nodes, order center nodes, resource center nodes, billing center nodes, office center nodes, and customer center nodes, etc. Each center node is a capability provider that can provide multiple capabilities.

[0071] The target business scenario refers to the business scenario invoked by the application. In this example, the target business scenario can be: querying user roaming fees, international roaming package tariffs, etc. Specifically, the specific type of target business scenario can be determined according to business needs, and this embodiment does not impose any restrictions on it.

[0072] The target capability API refers to the API interface registered on the blockchain management platform for the capability being invoked.

[0073] In practical implementation, the blockchain management platform can pre-register capability centers and the APIs providing capabilities for each capability center, and establish associated capability APIs for each business scenario. The process of establishing this association can be described in detail below with reference to the specific implementation method.

[0074] In one specific implementation of this application, before step 101 above, the following may also be included:

[0075] Step A1: In response to a newly launched business scenario, obtain the corresponding capability provider and the capabilities invoked by the capability provider under the business scenario.

[0076] In this embodiment of the application, when a new business scenario is added, the system can obtain the corresponding capability provider and the capabilities invoked by that capability provider in response to the new business scenario. Specifically, it can obtain the capabilities required to execute the newly added business scenario, and the capability provider to which those capabilities belong.

[0077] After obtaining the corresponding capability provider and the capabilities invoked by the capability provider in the business scenario, proceed to step A2.

[0078] Step A2: Configure the capability provider identifier corresponding to the capability provider, and the capability API identifier, capability API public key, and capability API private key corresponding to the capability API.

[0079] After obtaining the corresponding capability provider and the capabilities invoked by the capability provider in the business scenario, you can configure the capability provider identifier, capability API identifier, capability API public key, and capability API private key of the capability API corresponding to the capability on the blockchain management platform.

[0080] After configuring the capability provider's corresponding capability provider identifier, and the capability API identifier, capability API public key, and capability API private key corresponding to the capability, proceed to step A3.

[0081] Step A3: Establish the association between the business scenario, the capability provider identifier, the capability API identifier, the capability API public key, and the capability API private key.

[0082] After configuring the capability provider's corresponding capability provider identifier, and the capability API's capability API identifier, public key, and private key, the association between the business scenario, capability provider identifier, capability API identifier, public key, and private key can be established. For example, when launching a new business scenario involving the invocation of multiple capabilities from different capability centers (capability providers), a search reveals that the capability API registration is missing within the capability open operation platform. The missing capability API and its corresponding capability center are registered, and the blockchain platform connects the capability center as a node to the blockchain, assigning it a unique capability provider identifier (i.e., SysID) and capability provider public key. A unique capability identifier (APIID), public key, and private key are also assigned to the capability API. After completing the digital identity assignment, this identity can be used for capability API orchestration and scheduling within the business scenario, enabling capability scheduling with other capability APIs.

[0083] After the business orchestration is completed, the private keys of all relevant capability APIs are stored in the business scenario for subsequent calls to the relevant capabilities to achieve identity authentication.

[0084] For design-state frameworks, it can be as follows: Figure 2 As shown, the blockchain management platform includes a node management module, a key management module, an identity authentication module, and an on-chain management module. The capability open operation platform can include a capability container, a capability recommender, and a capability orchestrator. Specifically, the node management module manages the node center (i.e., the capability provider). The key management module manages the capability API public keys. The identity authentication module authenticates the private keys of the called capabilities based on the private keys stored on the blockchain management platform. The on-chain management module performs on-chain operations on encrypted call information. The capability container stores capabilities provided by capability providers. The capability recommender recommends capabilities. The capability orchestrator instructs capability APIs to be scheduled with other capability APIs during business orchestration.

[0085] It is understood that the above examples are merely examples listed to better understand the technical solutions provided in the embodiments of this application, and are not intended to be the only limitation on this embodiment.

[0086] After establishing the aforementioned relationships, the target capability APIs that are invoked in the target business scenario can be identified by combining these relationships. The implementation process can be described in detail below with reference to the specific implementation methods.

[0087] In another specific implementation of this application, step 101 above may include:

[0088] Sub-step B1: Based on the association, obtain the target capability provider identifier and the target capability API identifier corresponding to the target business scenario.

[0089] In this embodiment of the application, after establishing the above-mentioned association, the target capability provider identifier and the target capability API identifier corresponding to the target business scenario can be obtained based on the association.

[0090] After obtaining the target capability provider identifier and target capability API identifier corresponding to the target business scenario, execute sub-step B2.

[0091] Sub-step B2: Based on the target capability provider identifier and the target capability API identifier, determine the target capability API for the capability to be invoked in the target business scenario.

[0092] After obtaining the target capability provider identifier and target capability API identifier corresponding to the target business scenario, the target capability API of the capability to be invoked in the target business scenario can be determined based on the target capability provider identifier and target capability API identifier.

[0093] After obtaining the target capability API that will be invoked in the target business scenario, proceed to step 102.

[0094] Step 102: Obtain the private key of the target capability API.

[0095] After obtaining the target capability API that will be invoked in the target business scenario, the target capability API's private key can be obtained. Specifically, there are capability APIs with different capabilities registered on the blockchain management platform. When a certain capability is invoked in the target business scenario, the private key of the capability API registered on the platform for that capability can be obtained.

[0096] After obtaining the target capability API private key, proceed to step 103.

[0097] Step 103: Authenticate the private key of the target capability API and obtain the authentication result.

[0098] After obtaining the private key of the target capability API, authentication can be performed on the private key to obtain the authentication result. Specifically, this authentication process can be described in detail below with reference to the specific implementation method.

[0099] In one specific implementation of this application, step 103 may include:

[0100] Sub-step C1: Obtain the pre-saved capability API public key.

[0101] In this embodiment, after registering the capability API on the blockchain management platform, the corresponding capability API public key can be saved. When authenticating the target capability API private key, the pre-saved capability API public key can be obtained. Understandably, after obtaining the target capability API, the capability provider to which the target capability API belongs can be identified, and the capability API provided by that capability provider, along with its public key, can be obtained for subsequent authentication processes.

[0102] After obtaining the pre-saved capability API public key, execute sub-step C2.

[0103] Sub-step C2: Match the public key of the capability API with the private key of the target capability API one by one to obtain the matching result.

[0104] After obtaining the pre-saved capability API public key, you can match it one-to-one with the target capability API private key to obtain the matching result. That is, determine whether there is a capability API public key among the obtained capability API public keys that matches the target capability API private key.

[0105] After matching the public key of the capability API with the private key of the target capability API one by one to obtain the matching result, execute sub-step C3.

[0106] Sub-step C3: Based on the matching result, determine the authentication result of the target capability API private key.

[0107] After matching the public key of the capability API with the private key of the target capability API one by one to obtain the matching result, the authentication result of the private key of the target capability API can be determined based on the matching result.

[0108] Specifically, if the matching result indicates that there is a public key for the capability API that matches the private key for the target capability API, then the authentication result of the private key for the target capability API is determined to be successful.

[0109] If the matching result indicates that there is no public key for the target capability API that matches the private key for the target capability API, then the authentication result of the private key for the target capability API is determined to be an authentication failure.

[0110] When authentication fails, a capability call data packet can be generated based on the call log information corresponding to the target business scenario and uploaded to the private blockchain corresponding to the target business scenario for error troubleshooting. This implementation process can be described in detail below with reference to the specific implementation methods.

[0111] In another specific implementation of this application, after step 103 above, the following may also be included:

[0112] Step D1: In response to the authentication result indicating that the authentication of the target capability API private key failed, generate a capability call data packet based on the call log information corresponding to the target business scenario.

[0113] In this embodiment, after obtaining the authentication result of the target capability API private key, if the authentication result indicates that the target capability API private key authentication has failed, a capability call data packet can be generated based on the call log information corresponding to the target business scenario in response to the authentication result indicating that the target capability API private key authentication has failed.

[0114] After generating the capability call data packet based on the call log information corresponding to the target business scenario, proceed to step D2.

[0115] Step D2: Upload the capability call data packet to the private blockchain corresponding to the target business scenario.

[0116] After generating a capability call data packet based on the call log information corresponding to the target business scenario, the capability call data packet can be uploaded to the private blockchain corresponding to the target business scenario.

[0117] In this example, if authentication fails, a prompt will appear indicating that the capability API design needs to be improved, and the registration and design of the unregistered capability API should be supplemented according to the design state.

[0118] After authenticating the private key of the target capability API and obtaining the authentication result, proceed to step 104.

[0119] Step 104: In response to the authentication result indicating that the private key of the target capability API has been successfully authenticated, generate the capability call chain corresponding to the target business scenario based on the call information of the called capability and the target capability API.

[0120] After authenticating the private key of the target capability API and obtaining an authentication result, if the authentication result indicates that the target capability API private key has been successfully authenticated, then in response to the authentication result indicating successful authentication of the target capability API private key, a capability call chain corresponding to the target business scenario can be generated based on the call information of the called capability and the target capability API. In this example, the call information of the target capability API may include: call time, call request information, target capability API identifier, call data information, etc. Combining this information, encrypted capability call information can be generated and uploaded to the private blockchain. Then, the capability call chain is generated by combining all the private blockchains. This implementation process can be described in detail below with reference to the specific implementation method.

[0121] In one specific implementation of this application, step 104 may include:

[0122] Sub-step E1: Obtain the call time, call request information, target capability API identifier, and call data information corresponding to the target capability API.

[0123] In this embodiment, after successful authentication of the target capability API, the call time, call request information, target capability API identifier, and call data information corresponding to the target capability API can be obtained.

[0124] After obtaining the call time, call request information, target capability API identifier, and call data information corresponding to the target capability API, execute sub-step E2.

[0125] Sub-step E2: Encrypt the call time, the call request information, the target capability API identifier, and the call data information based on a preset hash algorithm to generate encrypted capability call information, and upload the encrypted capability call information to the private blockchain corresponding to the target business scenario.

[0126] After obtaining the call time, call request information, target capability API identifier, and call data information corresponding to the target capability API, the call time, call request information, target capability API identifier, and call data information can be encrypted based on a preset hash algorithm to generate encrypted capability call information, and then the encrypted capability call information can be uploaded to the private blockchain corresponding to the target business scenario.

[0127] Sub-step E3: In response to the completion of the target business scenario call operation, generate the capability call chain based on the encrypted capability call information of all the private blockchains.

[0128] After the target business scenario call operation is completed, a capability call chain can be generated based on the encrypted capability call information of all private blockchains. This capability call chain clearly identifies the capabilities invoked in the target business scenario and the relationships between them. For example, querying customer roaming fees involves four capability APIs: Customer Information Query, Roaming Country Tariff, International Data Package Tariff, and Remaining Customer Roaming Package Fee. Customer Information Query is provided by the Customer Center Node, Roaming Country Tariff by the Big Data Node, International Data Package Tariff by the Product Center Node, and Remaining Customer Roaming Package Fee by the Billing Center Node. The capability call chain reveals the four capability APIs invoked in the "Query Customer Roaming Fees" scenario and their call relationships, such as the capability API "Customer Information Query" calling the capability APIs "Roaming Country Tariff," "International Data Package Tariff," and "Remaining Customer Roaming Package Fee," etc.

[0129] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.

[0130] In one specific implementation, when an upper-layer application calls and runs a certain business scenario, it involves calling multiple capability APIs from different capability centers. The private key identity of the involved capability APIs is then authenticated and compared with the public key identity of the capability APIs stored in the public blockchain of the blockchain platform.

[0131] If identity authentication is successful, the API call can be made. During the process, the call log is encrypted using a hash algorithm provided by the blockchain. The four key data points—ApiId, Request, Data, and Time—are packaged to generate a unique hash value, which is then stored in a new block on the private blockchain for this business scenario. By recording the entire API call process through the blockchain-encrypted call chain, the caller and provider for each call can be clearly identified, ensuring the secure traceability and security of the capability call gateway.

[0132] If identity authentication fails, the business scenario will fail to obtain the public key of the capability API from the blockchain platform, indicating that the capability API is not registered on the blockchain platform and will return an authentication failure. The error call log will be packaged as a new block and connected to the private blockchain of the business scenario.

[0133] Once the business scenario call described above has been completed, the key information from this execution process (all private blockchain data uploaded to the chain) will be uploaded as a single block to the public blockchain of the blockchain platform. For example... Figure 5As shown, capability API call logs and business scenario execution information can be uploaded to the public blockchain. For example, capability API call logs Blocok21, Blocok22, Blocok23, and Blocok24 from the private blockchain, as well as business scenario execution information BLOCK1, BLOCK2, BLOCK3, and BLOCK4, can all be uploaded to the public blockchain.

[0134] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.

[0135] The design for runtime can be as follows: Figure 3 As shown, when upper-layer applications (i.e., capability callers) (such as CRM systems, marketing systems, network management systems, etc.) make business scenario calls, they can provide corresponding capabilities to the upper-layer callers through capability recommenders and capability orchestrators. The capabilities provided are provided by the capability center. After obtaining the capabilities called in the business scenario, identity authentication and on-chain management can be performed to obtain the corresponding capability call chain.

[0136] This application's embodiments ensure traceability and immutability by using call chain technology to monitor key data for each capability call and encrypting key information in the call logs using blockchain technology. Furthermore, this application's embodiments employ a hybrid blockchain approach, using a private blockchain for call records between capabilities within a single business scenario and connecting the entire business scenario call to a public blockchain. This maintains the confidentiality of calls within the business scenario while ensuring the speed and independence of on-chain processing for each individual business scenario call. By using blockchain to achieve secure encryption and storage of keys for capability supply and demand parties and capability APIs, as well as identity authentication throughout the capability API's lifecycle, the security of capability access across systems and platforms is effectively improved, reducing the risk of network attacks.

[0137] The above-described solution provided in this embodiment can be described in detail with reference to the following examples.

[0138] For the design phase process:

[0139] The business scenario of "querying customer roaming fees" needs to be added, which involves calling multiple capabilities from different systems. Through searching, it was found that the capability open operation platform lacks the "international roaming package tariff" capability API.

[0140] The missing API capability is registered for use, and the blockchain platform assigns it a unique API ID of "API2231256". At the same time, the ED25519 key pair function is selected to allocate public and private keys. Since the "Product Center" system that provides this API capability has not been registered before, the blockchain platform assigns it a public key and allows it to connect to the public blockchain as a node.

[0141] In this example, the Ed25519 encryption algorithm was chosen because its security is between that of RSA 2048 and RSA 4096, and its performance is several tens of times better.

[0142] After the business scenario orchestration is completed, the private keys of all relevant capability APIs are stored on the business scenario for subsequent calls to achieve identity authentication.

[0143] For the runtime process: (This can be described in detail in conjunction with the steps below)

[0144] S1: The upper-layer application "Customer Service Portal" system needs to query customer Zhang San's roaming charges. The business scenario "Query Customer Roaming Charges" is executed, involving calls to four capability APIs. For example... Figure 6 As shown, the four API capabilities involved in querying customer roaming fees are: customer information query, roaming country tariff, international data package tariff, and remaining roaming package fee. Among them, customer information query is provided by the customer center node, roaming country tariff is provided by the big data node, international data package tariff is provided by the product center node, and remaining roaming package fee is provided by the billing center node.

[0145] S2: During execution, the private key identity of the called capability API will be compared with the public key identity of the capability API stored in the public blockchain of the blockchain platform. If the identity authentication is successful, proceed to S3; if the identity authentication fails, it means that the capability API has not been accessed, and proceed to S4.

[0146] S3: Identity authentication passed. Taking the "International Roaming Package Fee" call as an example, the process requires encryption based on the hash algorithm provided by the blockchain. The four key data points involved in the call log—ApiId, Request, Data, and Time—are packaged to generate a unique hash value, which is then stored in the private blockchain of this business scenario. Through the blockchain-encrypted call chain, the entire process of API calls in the business scenario is recorded, clearly identifying the caller and provider for each call, thus achieving secure traceability and security for the capability call gateway. See Table 1 below:

[0147] Table 1:

[0148]

[0149]

[0150] S4: If a business scenario fails to obtain the public key for the capability API from the blockchain platform, it indicates that the capability API is not registered on the blockchain platform, and an authentication failure is returned. The error call log should then be packaged as a new block and integrated into the business scenario's private blockchain. Optionally, if authentication fails, a suggestion can be made to improve the capability API design, referring to the design state to supplement the registration and design of the unregistered capability API.

[0151] S5: Once the business scenario call is completed, the key information of this execution process (all private blockchain data uploaded to the chain) will be uploaded as a block to the public blockchain of the blockchain platform. The blockchain platform implements identity authentication management for access capability centers and capability APIs. It also innovatively proposes that the call logs of capability APIs between individual business scenarios be uploaded to the private chain as blocks, while the execution record of the entire business scenario is uploaded to the public chain as a block. This maintains the confidentiality of individual business scenarios while effectively improving the efficiency of on-chain operations.

[0152] The call chain generation method provided in this application, in response to an application calling a target business scenario, obtains the target capability API (Application Programming Interface) of the capability being called in the target business scenario. It then obtains the private key of the target capability API. The private key is authenticated, and an authentication result is obtained. In response to the authentication result indicating successful authentication of the target capability API private key, a capability call chain corresponding to the target business scenario is generated based on the call information of the called capability and the target capability API. This application embodiment, by assigning a corresponding private key to the capability API, authenticates the capability API private key during business scenario calls and generates a capability call chain corresponding to the target business scenario based on the call information of the called capability and the capability API, thereby achieving traceability and immutability of capability calls and fundamentally solving the problem of errors in call information.

[0153] Reference Figure 7 The diagram shows a schematic representation of a call chain generation device provided in an embodiment of this application. Figure 7 As shown, the call chain generation device 700 may include the following modules:

[0154] The target capability API acquisition module 710 is used to acquire the target capability API (application programming interface) of the capability called in the target business scenario in response to the application calling the target business scenario.

[0155] The target API private key acquisition module 720 is used to acquire the target capability API private key of the target capability API.

[0156] The authentication result acquisition module 730 is used to authenticate the private key of the target capability API and obtain the authentication result;

[0157] The capability call chain generation module 740 is used to generate a capability call chain corresponding to the target business scenario based on the call information of the called capability and the target capability API, in response to the authentication result indicating that the private key of the target capability API has been successfully authenticated.

[0158] Optionally, the device further includes:

[0159] The capability acquisition module is invoked in response to newly launched business scenarios to obtain the corresponding capability providers and the capabilities invoked by the capability providers under the business scenarios.

[0160] The capability information configuration module is used to configure the capability provider identifier corresponding to the capability provider, and the capability API identifier, capability API public key and capability API private key corresponding to the capability;

[0161] The association establishment module is used to establish the association between the business scenario, the capability provider identifier, the capability API identifier, the capability API public key, and the capability API private key.

[0162] Optionally, the target capability API acquisition module includes:

[0163] The target API identifier acquisition unit is used to acquire the target capability provider identifier and the target capability API identifier corresponding to the target business scenario based on the association relationship.

[0164] The target capability API determination unit is used to determine the target capability API of the capability to be invoked in the target business scenario based on the target capability provider identifier and the target capability API identifier.

[0165] Optionally, the authentication result acquisition module includes:

[0166] The Capability API Public Key Acquisition Unit is used to obtain pre-saved capability API public keys.

[0167] The matching result acquisition unit is used to match the capability API public key with the target capability API private key one by one to obtain the matching result;

[0168] The authentication result determination unit is used to determine the authentication result of the target capability API private key based on the matching result.

[0169] Optionally, the device further includes:

[0170] The capability data packet generation module is used to generate a capability call data packet based on the call log information corresponding to the target capability API private key authentication failure in response to the authentication result indicating that the authentication of the target capability API private key has failed.

[0171] The capability data packet upload module is used to upload the capability call data packet to the private blockchain corresponding to the target business scenario.

[0172] Optionally, the capability call chain generation module includes:

[0173] The call information acquisition unit is used to acquire the call time, call request information, target capability API identifier and call data information corresponding to the target capability API;

[0174] The encrypted call information generation unit is used to encrypt the call time, the call request information, the target capability API identifier and the call data information based on a preset hash algorithm, generate encrypted capability call information, and upload the encrypted capability call information to the private blockchain corresponding to the target business scenario;

[0175] The capability call chain generation unit is used to generate the capability call chain based on the encrypted capability call information of all the private blockchains in response to the completion of the target business scenario call operation.

[0176] The call chain generation apparatus provided in this application embodiment obtains the target capability API (Application Programming Interface) of the called capability in the target business scenario in response to an application calling the target business scenario. It then obtains the target capability API private key. The target capability API private key is authenticated, and an authentication result is obtained. In response to the authentication result indicating successful authentication of the target capability API private key, a capability call chain corresponding to the target business scenario is generated based on the call information of the called capability and the target capability API. This application embodiment, by assigning a corresponding private key to the capability API to authenticate the capability API private key during business scenario calls, and generating a capability call chain corresponding to the target business scenario based on the call information of the called capability and the capability API, achieves traceability and immutability of capability calls, fundamentally solving the problem of errors in call information.

[0177] This application also provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the above-described call chain generation method.

[0178] Figure 8 A schematic diagram of the structure of an electronic device 800 according to an embodiment of the present invention is shown. Figure 8As shown, the electronic device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 802 or loaded from storage unit 808 into random access memory (RAM) 803. The RAM 803 can also store various programs and data required for the operation of the electronic device 800. The CPU 801, ROM 802, and RAM 803 are interconnected via bus 804. An input / output (I / O) interface 805 is also connected to bus 804.

[0179] Multiple components in electronic device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, microphone, etc.; output unit 807, such as various types of displays, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows electronic device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0180] The various processes and handling described above can be executed by processing unit 801. For example, the methods of any of the above embodiments can be implemented as computer software programs tangibly contained in a computer-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by CPU 801, one or more actions of the methods described above can be performed.

[0181] Additionally, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described call chain generation method.

[0182] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0183] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0184] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminals (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0185] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0186] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal, causing a series of operational steps to be executed on the computer or other programmable terminal to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0187] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0188] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes said element.

[0189] The above provides a detailed description of a call chain generation method, a call chain generation device, an electronic device, and a computer-readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and its core ideas. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for generating a call chain, characterized in that, The method includes: In response to an application calling a target business scenario, obtain the target capability API (Application Programming Interface) of the capability called in the target business scenario. Obtain the target capability API private key; Authenticate the private key of the target capability API to obtain the authentication result; In response to the authentication result indicating that the private key of the target capability API has been successfully authenticated, a capability call chain corresponding to the target business scenario is generated based on the call information of the called capability and the target capability API. The process of generating a capability call chain corresponding to the target business scenario based on the call information of the called capability and the target capability API includes: Obtain the call time, call request information, target capability API identifier, and call data information corresponding to the target capability API; The call time, the call request information, the target capability API identifier, and the call data information are encrypted using a preset hash algorithm to generate encrypted capability call information, and the encrypted capability call information is uploaded to the private blockchain corresponding to the target business scenario. In response to the completion of the target business scenario call operation, the capability call chain is generated based on the encrypted capability call information of all the private blockchains; The private blockchain's API call logs and execution information from multiple business scenarios are uploaded to the public blockchain. Before obtaining the target capability API that is invoked in the target business scenario, the following is also included: In response to newly launched business scenarios, obtain the corresponding capability provider under the business scenario and the capabilities invoked by the capability provider; Configure the capability provider identifier corresponding to the capability provider, and the capability API identifier, capability API public key, and capability API private key corresponding to the capability; Establish the association between the business scenario, the capability provider identifier, the capability API identifier, the capability API public key, and the capability API private key; Assign a unique capability identifier, capability API public key, and capability API private key to the capability API; After digital identity assignment is completed, the identity can be used by the capability API to orchestrate and schedule capabilities in business scenarios, and can be used for capability scheduling with other capability APIs.

2. The method according to claim 1, characterized in that, The process of obtaining the target capability API that is invoked in the target business scenario includes: Based on the aforementioned relationship, obtain the target capability provider identifier and the target capability API identifier corresponding to the target business scenario; Based on the target capability provider identifier and the target capability API identifier, the target capability API for the capability to be invoked in the target business scenario is determined.

3. The method according to claim 1, characterized in that, The authentication of the target capability API private key to obtain the authentication result includes: Retrieve the pre-saved API public key; The public key of the capability API is matched one by one with the private key of the target capability API to obtain the matching result; Based on the matching results, the authentication result of the target capability API private key is determined.

4. The method according to claim 1, characterized in that, After authenticating the private key of the target capability API and obtaining the authentication result, the process further includes: In response to the authentication result indicating that the authentication of the target capability API private key failed, a capability call data packet is generated based on the call log information corresponding to the target business scenario; The capability call data packet is uploaded to the private blockchain corresponding to the target business scenario.

5. A call chain generation device, characterized in that, The device includes: The target capability API acquisition module is used to obtain the target capability API (application programming interface) of the capability called in the target business scenario in response to the application calling the target business scenario. The target API private key acquisition module is used to acquire the target capability API private key of the target capability API; The authentication result acquisition module is used to authenticate the private key of the target capability API and obtain the authentication result; The capability call chain generation module is used to generate a capability call chain corresponding to the target business scenario based on the call information of the called capability and the target capability API, in response to the authentication result indicating that the private key of the target capability API has been successfully authenticated. The device further includes: The capability acquisition module is invoked in response to newly launched business scenarios to obtain the corresponding capability providers and the capabilities invoked by the capability providers under the business scenarios. The capability information configuration module is used to configure the capability provider identifier corresponding to the capability provider, and the capability API identifier, capability API public key and capability API private key corresponding to the capability; The association establishment module is used to establish the association relationship between the business scenario, the capability provider identifier, the capability API identifier, the capability API public key, and the capability API private key; The apparatus is further configured to generate a capability call chain corresponding to the target business scenario based on the call information of the called capability and the target capability API, including: Obtain the call time, call request information, target capability API identifier, and call data information corresponding to the target capability API; The call time, the call request information, the target capability API identifier, and the call data information are encrypted using a preset hash algorithm to generate encrypted capability call information, and the encrypted capability call information is uploaded to the private blockchain corresponding to the target business scenario. In response to the completion of the target business scenario call operation, the capability call chain is generated based on the encrypted capability call information of all the private blockchains; The private blockchain's API call logs and execution information for multiple business scenarios are uploaded to the public blockchain.

6. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the call chain generation method of any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the call chain generation method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Application program interface calling method, device and apparatus and readable storage medium

    CN110795174A

  • Business scene-oriented call chain processing method and device and medium

    CN114648323A

  • API request and response balancing and control on blockchain

    US20190114182A1