Inter-component communication method, device, electronic equipment and system

By using the service lookup method and dynamic scanning initialization of the intermediate service component, the problem of strong coupling between components is solved, and low-coupling communication between components is achieved, which improves communication efficiency and independence and reduces development and maintenance complexity.

CN121387582APending Publication Date: 2026-01-23SHENZHEN GREEN CONNECTION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511287658.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

In a component-based architecture, communication between components typically uses direct references or direct calls, resulting in strong coupling between components and making it difficult to achieve independent development and maintenance of components.

Method used

By setting service lookup methods through intermediate service components, service classes are dynamically scanned and initialized, and a service instance pool is established to achieve loosely coupled communication between components and reduce dependencies between components.

Benefits of technology

It improves the efficiency and flexibility of communication between components, reduces the complexity of development and maintenance, and improves the development efficiency and maintainability of applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387582A_ABST
    Figure CN121387582A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of software development, and discloses an inter-component communication method and device, electronic equipment and a system.The method comprises the steps that when a service calling request of any first service component is detected, the service calling request of any first service component is searched through a service searching method set by an intermediate service component; searching whether a target service instance complying with a target service protocol corresponding to the service calling request exists in a service instance pool corresponding to the intermediate service component; wherein the target service instance is a service instance corresponding to the second business component; and when finding that a target service instance complying with a target service protocol corresponding to the service calling request exists in a service instance pool corresponding to the intermediate service component, obtaining the target service instance to call a business service requested by the service calling request. Visibly, the low-coupling communication between the service components can be realized by setting the intermediate service component, so that the communication mechanism between the components is optimized, and the communication efficiency and flexibility between the components are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software development technology, and in particular to a communication method, apparatus, electronic device, and system between components. Background Technology

[0002] In traditional software development, as software scales up and business complexity increases, software architecture typically evolves from a traditional monolithic architecture to a multi-module component-based architecture to adapt to ever-increasing software development needs.

[0003] However, in actual development, it has been found that in a component-based architecture, there are often code dependencies between business modules, and communication between components usually takes the form of direct references or direct calls, resulting in strong coupling between components. If one component is modified, it may affect other dependent components, making it difficult to achieve independent development and maintenance of components.

[0004] Therefore, it is particularly important to propose a technical solution that can optimize the communication mechanism between components, improve the communication efficiency and flexibility between components, and reduce the complexity of component development and maintenance. Summary of the Invention

[0005] This invention provides a communication method, apparatus, electronic device, and system for inter-component communication, which can optimize the communication mechanism between components, improve the communication efficiency and flexibility between components, and reduce the complexity of component development and maintenance.

[0006] To address the aforementioned technical problems, the first aspect of this invention discloses a communication method between components. The method is applied to an electronic device, which has an application program installed and is communicatively connected to a network-attached storage device (NAT). The electronic device can access the NAT via the application program. The application program includes an intermediate service component and multiple service components, each of which depends on the intermediate service component. The method includes: When a service call request from any first business component is detected, the service lookup method set by the intermediate service component is used to search whether there is a target service instance in the service instance pool corresponding to the intermediate service component that conforms to the target service protocol corresponding to the service call request; wherein, the target service instance is a service instance corresponding to the second business component, and the first business component and the second business component are each one of the business components; When a target service instance that conforms to the target service protocol corresponding to the service call request is found in the service instance pool corresponding to the intermediate service component, the target service instance is obtained to call the business service requested by the service call request.

[0007] As an optional implementation, in the first aspect of the present invention, the method further includes: When the application starts, it dynamically scans at least one service class in the project corresponding to the application that meets the preset protocol conditions, and stores each service class in a service class list; each service class is used to implement one of the business components. For each service class in the service class list, based on the service protocol followed by the service class, an initialization operation is performed on the service class to obtain the service instance corresponding to the service class, and the service instance is stored in the service instance pool; The service instance pool includes several service instances.

[0008] As an optional implementation, in the first aspect of the present invention, the dynamic scanning of at least one service class in the project corresponding to the application that satisfies preset protocol conditions includes: Scan the project corresponding to the application to obtain all classes defined in the project; For each class, when traversing to that class, the class name is extracted from the class identifier corresponding to that class based on a predefined naming format; Based on the class name of each class, at least one candidate class whose class name matches the determined target name format is selected from all the classes; Select at least one service class from all the candidate classes that conforms to a predefined standard service protocol.

[0009] As an optional implementation, in the first aspect of the invention, the step of filtering at least one candidate class whose class name matches the determined target name format from all the classes based on the class name of each class includes: For each class, determine whether the class name contains the determined target string; the target string is associated with the target identifier corresponding to the application, and the target string includes at least one character; For each of the aforementioned classes, when it is determined that the class name contains the target string, the class is identified as a candidate class.

[0010] As an optional implementation, in the first aspect of the invention, each of the service classes is created in the following manner: Configure the service class to conform to a predefined standard service protocol, and configure the service class to return a service instance corresponding to the service class when implementing the standard service protocol; Configure the service instance corresponding to this service class to comply with one of the predefined business service protocols, and configure the service instance to return the business instance corresponding to the business service protocol when implementing the business service protocol.

[0011] As an optional implementation, in the first aspect of the present invention, each of the said service protocols is defined in the following manner: The protocol name of the service protocol is determined according to the pre-defined protocol naming conventions and the business component to which the service protocol belongs; Based on the protocol name, a protocol file for defining the business service protocol is created in the intermediate service component; In the protocol file, the access control modifier corresponding to the service protocol is defined as public access, so that the service protocol is defined as a public protocol; The business service agreement defines the implementation method of the business service agreement; wherein, the implementation method includes the business parameters that need to be passed in and / or the abstract parameters that need to be returned.

[0012] As an optional implementation, in the first aspect of the present invention, the target service protocol includes the standard service protocol and the target business service protocol; the target business service protocol is one of the business service protocols. The step of obtaining the target service instance to invoke the business service requested by the service invocation request includes: When the service call request is used to indicate a request to jump from the page of the first business component to the page of the second business component, the target service instance returned by the service lookup method is obtained; Based on the target service instance, the target business service protocol that the target service instance conforms to is implemented to return the business instance corresponding to the target business service protocol; the business instance includes a business page, and the business page belongs to one of the pages of the second business component; Based on the navigation route corresponding to the first business component, the user is redirected from the current page of the first business component to the business page.

[0013] A second aspect of the present invention discloses an inter-component communication device, the device being applied in an electronic device, the electronic device having an application program installed thereon, the electronic device being communicatively connected to a network-attached storage device, and the electronic device being able to access the network-attached storage device through the application program; wherein, the application program includes an intermediate service component and multiple service components, each of the service components depending on the intermediate service component; the device includes: The lookup module is used to, when a service call request of any first business component is detected, use the service lookup method set by the intermediate service component to look up whether there is a target service instance in the service instance pool corresponding to the intermediate service component that conforms to the target service protocol corresponding to the service call request; wherein, the target service instance is a service instance corresponding to the second business component, and the first business component and the second business component are respectively one of the business components; The service invocation module is used to obtain the target service instance when a target service instance that conforms to the target service protocol corresponding to the service invocation request is found in the service instance pool corresponding to the intermediate service component, so as to invoke the business service requested by the service invocation request.

[0014] As an optional implementation, in a second aspect of the invention, the apparatus further includes: The scanning module is configured to dynamically scan for at least one service class in the project corresponding to the application that meets preset protocol conditions when the application starts, and store each service class in a service class list; each service class is used to implement one of the business components. An initialization module is used to perform an initialization operation on each service class in the service class list based on the service protocol followed by the service class, so as to obtain a service instance corresponding to the service class. The storage module is used to store the service instances in the service instance pool; The service instance pool includes several service instances.

[0015] As an optional implementation, in a second aspect of the present invention, the specific method by which the scanning module dynamically scans the project corresponding to the application for at least one service class that meets preset protocol conditions includes: Scan the project corresponding to the application to obtain all classes defined in the project; For each class, when traversing to that class, the class name is extracted from the class identifier corresponding to that class based on a predefined naming format; Based on the class name of each class, at least one candidate class whose class name matches the determined target name format is selected from all the classes; Select at least one service class from all the candidate classes that conforms to a predefined standard service protocol.

[0016] As an optional implementation, in a second aspect of the invention, the specific method by which the scanning module filters at least one candidate class whose class name matches the determined target name format from all the classes based on the class name of each class includes: For each class, determine whether the class name contains the determined target string; the target string is associated with the target identifier corresponding to the application, and the target string includes at least one character; For each of the aforementioned classes, when it is determined that the class name contains the target string, the class is identified as a candidate class.

[0017] As an optional implementation, in a second aspect of the invention, each of the service classes is created in the following manner: Configure the service class to conform to a predefined standard service protocol, and configure the service class to return a service instance corresponding to the service class when implementing the standard service protocol; Configure the service instance corresponding to this service class to comply with one of the predefined business service protocols, and configure the service instance to return the business instance corresponding to the business service protocol when implementing the business service protocol.

[0018] As an optional implementation, in the second aspect of the invention, each of the aforementioned service protocols is defined in the following manner: The protocol name of the service protocol is determined according to the pre-defined protocol naming conventions and the business component to which the service protocol belongs; Based on the protocol name, a protocol file for defining the business service protocol is created in the intermediate service component; In the protocol file, the access control modifier corresponding to the service protocol is defined as public access, so that the service protocol is defined as a public protocol; The business service agreement defines the implementation method of the business service agreement; wherein, the implementation method includes the business parameters that need to be passed in and / or the abstract parameters that need to be returned.

[0019] As an optional implementation, in a second aspect of the present invention, the target service protocol includes the standard service protocol and the target business service protocol; the target business service protocol is one of the business service protocols. The specific method by which the service invocation module obtains the target service instance and invokes the business service requested by the service invocation request includes: When the service call request is used to indicate a request to jump from the page of the first business component to the page of the second business component, the target service instance returned by the service lookup method is obtained; Based on the target service instance, the target business service protocol that the target service instance conforms to is implemented to return the business instance corresponding to the target business service protocol; the business instance includes a business page, and the business page belongs to one of the pages of the second business component; Based on the navigation route corresponding to the first business component, the user is redirected from the current page of the first business component to the business page.

[0020] A third aspect of the present invention discloses an electronic device, the electronic device comprising: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute some or all of the steps of the inter-component communication method disclosed in the first aspect of the present invention.

[0021] The fourth aspect of the present invention discloses an inter-component communication system, the system comprising an inter-component communication device as disclosed in the second aspect of the present invention, and a network-attached storage device communicatively connected to the inter-component communication device; wherein the inter-component communication device utilizes an intermediate service component to implement cross-component invocation of business services according to the inter-component communication method disclosed in the first aspect of the present invention, so as to realize inter-component communication; or, The system includes an electronic device as disclosed in the third aspect of the present invention, and a network-attached storage device communicatively connected to the electronic device; wherein the electronic device utilizes an intermediate service component to implement cross-component invocation of business services in accordance with the inter-component communication method disclosed in the first aspect of the present invention, so as to realize inter-component communication.

[0022] The fifth aspect of the present invention discloses a computer storage medium storing computer instructions, which, when invoked, are used to execute some or all of the steps of the inter-component communication method disclosed in the first aspect of the present invention.

[0023] Compared with the prior art, the present invention has the following beneficial effects: Implementing this invention enables the detection of a service call request from a first business component. By using a service lookup method set by an intermediate service component, the invention searches the service instance pool for a target service instance that conforms to the corresponding target service protocol. If such a target service instance is found, it is acquired to call the corresponding business service. This allows for communication between business components through an intermediate service component, reducing the dependence of business components on other business components and achieving low-coupling communication between them. By providing a unified component communication mechanism, the invention optimizes the communication mechanism between components, improving communication efficiency and flexibility while enhancing component independence. This reduces the complexity of developing and maintaining business components, thereby improving application development efficiency and maintainability, and ultimately enhancing application reliability. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a flowchart illustrating a communication method between components disclosed in an embodiment of the present invention; Figure 2 This is a flowchart illustrating another inter-component communication method disclosed in an embodiment of the present invention; Figure 3 This is a schematic diagram of an inter-component communication architecture disclosed in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a communication device between components disclosed in an embodiment of the present invention; Figure 5 This is a schematic diagram of another inter-component communication device disclosed in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an inter-component communication system disclosed in an embodiment of the present invention; Figure 8 This is a schematic diagram of another inter-component communication system disclosed in an embodiment of the present invention. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0027] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.

[0028] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0029] This invention discloses a communication method, apparatus, electronic device, and system for inter-component components. Upon detecting a service call request from a first business component, it uses a service lookup method set by an intermediate service component to search the service instance pool for a target service instance that conforms to the corresponding target service protocol. If a target service instance is found, it is acquired to call the corresponding business service. By setting up an intermediate service component for inter-component communication, business components become dependent on the intermediate service component, reducing their dependence on other business components. This achieves low-coupling communication between business components. By providing a unified component communication mechanism, it optimizes the communication mechanism between components, improving communication efficiency and flexibility while enhancing component independence. This reduces the complexity of business component development and maintenance, thereby improving application development efficiency and maintainability, and ultimately, application reliability. Detailed descriptions follow.

[0030] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating a communication method between components disclosed in an embodiment of the present invention. Figure 1The described inter-component communication method can be applied to inter-component communication devices, which may include one of a smart terminal, a smart device, a smart system, and a server, wherein the server is a local server or a cloud server, and this embodiment of the invention is not limited thereto. The method can also be applied to electronic devices, where an application is installed, and the electronic device is communicatively connected to a network-attached storage device (NAT). The electronic device can access the NAT through the application. Further, the application may include an intermediate service component and multiple business components, each of which depends on the intermediate service component. Optionally, the business components do not depend on each other, and this embodiment of the invention is not limited thereto. Further optionally, the application may be an application running on the iOS platform, i.e., the aforementioned business components may be iOS components, and this embodiment of the invention is not limited thereto. Figure 1 As shown, the communication method between these components may include the following operations: 101. When a service call request from any first business component is detected, the service lookup method set by the intermediate service component is used to check whether there is a target service instance in the service instance pool corresponding to the intermediate service component that conforms to the target service protocol corresponding to the service call request.

[0031] In this embodiment of the invention, the target service instance is the service instance corresponding to the second business component, and the first business component and the second business component are respectively one of the business components of the application; for example, the first business component can be a login component, the second business component can be a comic component, and the first business component and the second business component can also be other types of components in the application, which is not limited in this embodiment of the invention; wherein, the login component is used to implement the account login function, and the comic component is used to implement the comic content browsing function.

[0032] In this embodiment of the invention, optionally, each business component can be managed through a pod, and the business component needs to be added to the podfile of the project. This allows the same component file to be referenced in different projects under the project, that is, the same code can be used in different projects. Therefore, it can avoid code duplication, improve code reuse efficiency, facilitate unified code maintenance, and ensure the consistency of component versions.

[0033] In this embodiment of the invention, optionally, the service call request can be used to request a service instance of another business component, and the service instance may include data and / or a page; this embodiment of the invention does not impose any limitations. Further optionally, the service call request of the first business component can only be triggered when the first business component is detected to meet pre-set service call conditions. For example, when the first business component is a login component, the service call request for requesting page redirection is only triggered when the user input information received on the login component is detected to be correct / matching. The user input information includes at least account information; optionally, the user input information may also include account verification information, which may include a password and / or verification code; this embodiment of the invention does not impose any limitations.

[0034] In this embodiment of the invention, optionally, a service manager corresponding to the intermediate service component can be created, and the service manager is a singleton; further optionally, the above-mentioned service instance pool can be set in the service manager, so as to ensure that each service instance contained in the service instance pool is unique in the world. This embodiment of the invention does not impose any limitations.

[0035] In this embodiment of the invention, optionally, the service instance pool may include a plurality of service instances; further optionally, the service class corresponding to each service instance in the service instance pool conforms to a predefined standard service protocol; further optionally, each service instance in the service instance pool may also conform to different business service protocols, which are not limited in this embodiment of the invention; wherein, each business service protocol corresponds to a different business service.

[0036] In this embodiment of the invention, optionally, the service lookup method set by the intermediate service component can specifically implement the service lookup function through traversal, and this embodiment of the invention does not limit it.

[0037] 102. When a target service instance that conforms to the target service protocol corresponding to the service call request is found in the service instance pool corresponding to the intermediate service component, the target service instance is obtained to call the business service requested by the service call request.

[0038] In this embodiment of the invention, optionally, the service manager described above may perform the operations of steps 101-102, and this embodiment of the invention does not limit the scope of the operation.

[0039] As can be seen, the method described in the embodiments of the present invention can, when a service call request of the first business component is detected, search for whether there is a target service instance in the service instance pool that conforms to the corresponding target service protocol through the service search method set by the intermediate service component. If the target service instance is found, it is obtained to call the corresponding business service. By setting the intermediate service component for communication between business components, the business components can rely on the intermediate service component to reduce their dependence on other business components, thereby achieving low-coupling communication between business components. By providing a unified component communication mechanism, the communication mechanism between components is optimized. While improving the communication efficiency and flexibility between components, the independence between components is also improved, which helps to reduce the complexity of business component development and maintenance, thereby improving the development efficiency and maintainability of the application and improving the reliability of the application.

[0040] Example 2 Please see Figure 2 , Figure 2 This is a flowchart illustrating a communication method between components disclosed in an embodiment of the present invention. Figure 2 The described inter-component communication method can be applied to inter-component communication devices, which may include one of a smart terminal, a smart device, a smart system, and a server, wherein the server is a local server or a cloud server, and this embodiment of the invention is not limited thereto. The method can also be applied to electronic devices, where an application is installed, and the electronic device is communicatively connected to a network-attached storage device (NAT). The electronic device can access the NAT through the application. Further, the application may include an intermediate service component and multiple business components, each of which depends on the intermediate service component. Optionally, the business components do not depend on each other, and this embodiment of the invention is not limited thereto. Further optionally, the application may be an application running on the iOS platform, i.e., the aforementioned business components may be iOS components, and this embodiment of the invention is not limited thereto. Figure 2 As shown, the communication method between these components may include the following operations: 201. When the application starts, dynamically scan the project corresponding to the application for at least one service class that meets the preset protocol conditions, and store each service class in the service class list.

[0041] In this embodiment of the invention, each service class is used to implement one of the business components; more specifically, each service class can be used to implement part of the functions of one of the business components, and this embodiment of the invention does not limit this.

[0042] In this embodiment of the invention, the service class list may include several service classes.

[0043] 202. For each service class in the service class list, perform an initialization operation on the service class based on the service protocol it follows, obtain the service instance corresponding to the service class, and store the service instance in the service instance pool.

[0044] In this embodiment of the invention, the service instance pool includes several service instances.

[0045] In this embodiment of the invention, optionally, the service class list and the service instance pool can be set in the intermediate service component in the form of arrays; further optionally, the service class list and the service instance pool can be set in the service manager created by the intermediate service component in the form of arrays, and this embodiment of the invention does not impose any limitations.

[0046] In this embodiment of the invention, performing an initialization operation on a service class can be understood as: implementing one of the service protocols that the service class follows; more specifically, it can be: implementing the standard service protocol that the service class follows, and obtaining a service instance corresponding to the service class.

[0047] 203. When a service call request from any first business component is detected, the service lookup method set by the intermediate service component is used to check whether there is a target service instance in the service instance pool corresponding to the intermediate service component that conforms to the target service protocol corresponding to the service call request.

[0048] In this embodiment of the invention, the target service instance is the service instance corresponding to the second business component, and the first business component and the second business component are respectively one of the business components.

[0049] 204. When a target service instance that conforms to the target service protocol corresponding to the service call request is found in the service instance pool corresponding to the intermediate service component, the target service instance is obtained to call the business service requested by the service call request.

[0050] For further detailed descriptions of steps 203-204 in this embodiment of the invention, please refer to the detailed description of steps 101-102 in Embodiment 1. These descriptions will not be repeated in this embodiment of the invention.

[0051] As can be seen, the method described in the embodiments of the present invention can, when a service call request of the first business component is detected, search for whether there is a target service instance in the service instance pool that conforms to the corresponding target service protocol through the service search method set by the intermediate service component. If the target service instance is found, it is obtained to call the corresponding business service. By setting the intermediate service component for communication between business components, the business components can rely on the intermediate service component to reduce their dependence on other business components, thereby achieving low-coupling communication between business components. By providing a unified component communication mechanism, the communication mechanism between components is optimized. While improving the communication efficiency and flexibility between components, the independence between components is also improved, which helps to reduce the complexity of business component development and maintenance, thereby improving the development efficiency and maintainability of the application and improving the reliability of the application. Furthermore, it can dynamically scan service classes in the project that meet preset protocol conditions when the application starts, store the service classes in a service class list, and then initialize the service classes based on the service protocols they comply with to obtain corresponding service instances. These service instances are then stored in a service instance pool. This allows for the dynamic collection of service classes corresponding to business components without manually collecting and registering service instances of each service class to intermediate service components, improving the scanning efficiency and comprehensiveness of service classes, thereby improving the registration efficiency of service instances. Moreover, by storing service instances in a service instance pool after instantiating service classes, it is beneficial to centrally manage service instances and facilitate repeated calls to service instances. This improves both the management efficiency of service instances and the response efficiency of service calls, which in turn further enhances the communication efficiency between components.

[0052] In an optional embodiment, dynamically scanning at least one service class in the project corresponding to the application that meets preset protocol conditions may include the following operations: Scan the project corresponding to the application to obtain all classes defined in the project; For each class, when traversing to that class, the class name is extracted from the class identifier corresponding to that class based on a predefined naming format; Based on the class name of each class, at least one candidate class whose class name matches the determined target name format is selected from all classes; Select at least one service class from all candidate classes that conforms to a predefined standard service protocol.

[0053] For example, all classes in the above project can be scanned using objc_getClassList, or all classes in the project can be scanned in other ways. This embodiment of the invention does not limit the scope of the invention.

[0054] For example, for each class, when traversing to that class, the class name is extracted from the class identifier corresponding to that class based on a pre-defined naming format. Specifically, since the default naming format in the project is "component name.class name", the class name after "." can be extracted from the class identifier using className.components(separatedBy: ".").last. This embodiment of the invention does not impose any limitations.

[0055] Optionally, the standard service protocol can be defined as follows: when implementing the standard service protocol, an initialization operation needs to be performed on the service class to obtain the service instance corresponding to the service class.

[0056] As can be seen, this optional embodiment can dynamically scan all classes defined in the project corresponding to the application, extract the class name from the class identifier corresponding to each class, filter at least one candidate class whose class name matches the determined target name format from all classes, and then filter at least one service class that conforms to the predefined standard service protocol from all candidate classes. This can improve the efficiency and comprehensiveness of dynamic scanning of classes corresponding to the application, while improving the efficiency and accuracy of filtering classes that conform to the standard service protocol. It can realize the dynamic collection of service classes that conform to the standard service protocol, thereby improving the reliability of service classes stored in the service class list and the reliability of service instances stored in the service instance pool.

[0057] In this optional embodiment, optionally, filtering at least one candidate class that matches the determined target name format from all classes based on the class name of each class may include the following operations: For each class, determine whether the class name contains the identified target string; the target string is associated with the target identifier corresponding to the application, and the target string includes at least one character; For each class, if it is determined that the class name contains the target string, the class is identified as a candidate class.

[0058] For example, the target identifier corresponding to the application can be the identifier of the application, the associated identifier of the brand to which the application belongs, the code name used to develop the application, or other identifiers that are different from the classes or third-party classes preset in other development frameworks. This embodiment of the invention does not limit the scope of the target identifier.

[0059] For example, the target string can be "UG" or other strings, and this embodiment of the invention does not limit it.

[0060] As can be seen, this optional embodiment can also determine whether the class name of each class contains a target string associated with the target identifier corresponding to the application. If it is determined that the class name contains a target string, the class is identified as a candidate class, thereby efficiently filtering out non-developer-created types (such as third-party classes) from all scanned classes. This can improve the filtering efficiency for all scanned classes, which is beneficial to further improving the filtering efficiency of classes that comply with standard service agreements.

[0061] In another alternative embodiment, each service class can be created in the following way: Configure the service class to conform to a predefined standard service protocol, and configure the service class to return the service instance corresponding to the service class when implementing the standard service protocol; Configure the service instance corresponding to this service class to conform to one of the predefined business service protocols, and configure the service instance to return the business instance corresponding to the business service protocol when implementing the business service protocol.

[0062] Therefore, it is evident that each type of service must comply with the standard service agreement and one of the business service agreements.

[0063] Optionally, a business instance may include business data and / or business pages, but this embodiment of the invention does not impose any limitations.

[0064] For example, the comic service class needs to first comply with the standard service agreement, and then comply with the comic service agreement. It can be defined in the comic service agreement that when implementing the comic service agreement, a comic page instance that inherits from UIViewController needs to be returned. This embodiment of the invention does not impose any limitations.

[0065] As can be seen, this optional embodiment can create a service class by first setting the service class to conform to a standard service protocol, and then setting the service instance corresponding to the service class to conform to one of the predefined business service protocols. In order to return the business instance corresponding to the business service protocol when implementing the business service protocol, the intermediate service component can easily scan and register the service instance of the service class to the service instance pool when the service class conforms to the standard service protocol. This is conducive to scanning all service classes more accurately. Furthermore, by setting the service class to conform to the business service protocol, it is conducive to calling the business instance corresponding to the service class more efficiently. This helps to improve the response efficiency and accuracy of service calls, and further improves the communication efficiency and accuracy between components.

[0066] In this optional embodiment, each service protocol may be defined in the following ways: The protocol name of the service protocol is determined according to the pre-defined protocol naming conventions and the business component to which the service protocol belongs; Based on the protocol name, create a protocol file in the intermediate service component to define the business service protocol; Define the access control modifier corresponding to the business service protocol in the protocol file as public access, so as to define the business service protocol as a public protocol; The business service agreement defines the implementation method of the business service agreement; the implementation method includes the business parameters that need to be passed in and / or the abstract parameters that need to be returned.

[0067] Optionally, the protocol name of the business service protocol can be the business component name + Service; for example, if the business service protocol is the business service protocol of the comic component, the protocol name can be UGComicService, and this embodiment of the invention does not impose any limitations.

[0068] For example, if the application is developed using the Swift language, the protocol file created above will be a file with the suffix ".swift". This embodiment of the invention does not impose any limitations.

[0069] The purpose of defining the access control modifier corresponding to the business service protocol as public is to expose the business service protocol to the intermediate service component, so that the classes of other business components can comply with the business service protocol through the intermediate service component. This defines the class as complying with the business service protocol, which is beneficial for other classes to reference and comply with the business service protocol more efficiently.

[0070] The implementation method corresponding to the business service protocol can be a method / function under the business service protocol, which is not limited in this embodiment of the invention; furthermore, the business parameters that need to be passed in under this implementation method can be used to distinguish different businesses, which is not limited in this embodiment of the invention.

[0071] Optionally, in this implementation, the abstract parameter to be returned can be a system class. Furthermore, the class of the business instance to be returned by the business service protocol is a subclass inherited from the system class. For example, if the business service protocol is the aforementioned comic service protocol, and the comic service protocol needs to return a comic page, then the abstract parameter to be returned by the business service protocol can be the system class corresponding to the comic page, and the comic page is a subclass of UIViewController. That is, the abstract parameter can be defined as UIViewController, and this embodiment of the invention does not impose limitations. Through the above example, page calls can be implemented without directly exposing the real class name corresponding to the comic page, thereby eliminating the dependency of other components on the comic component.

[0072] As can be seen, this optional embodiment can also determine the protocol name of the business service protocol according to the pre-set protocol naming specifications and the business component to which the business service protocol belongs, so as to create a protocol file in the intermediate service component to define the business service protocol based on the protocol name, define the access control modifier corresponding to the business service protocol as public access, and define the implementation method corresponding to the business service protocol. This can improve the accuracy and reliability of the definition of the business service protocol, thereby enabling various components in the application to reference and comply with the business service protocol more efficiently and accurately, which in turn helps to further improve the communication efficiency and accuracy between components.

[0073] In this optional embodiment, the target service protocol may optionally include a standard service protocol and a target business service protocol; the target business service protocol is one of the business service protocols.

[0074] Optionally, obtaining the target service instance to invoke the business service requested by the service invocation request may include the following operations: When a service call request is used to indicate a jump from the page of the first business component to the page of the second business component, the target service instance returned by the service lookup method is obtained. Based on the target service instance, implement the target business service protocol that the target service instance complies with, so as to return the business instance corresponding to the target business service protocol; wherein, the business instance includes a business page, and the business page is one of the pages of the second business component; Based on the navigation route corresponding to the first business component, the user is redirected from the current page of the first business component to the business page.

[0075] For example, when the first business component is a login component and the second business component is a comic component, the current page of the first business component is the login page, and the business page of the second business component can be the comic page. The above steps can be specifically as follows: obtain the comic service instance returned by the service lookup method, and then implement the comic service washing that the comic service instance follows in order to return the comic page, thereby jumping from the login page to the comic page based on the navigation route of the login component. This embodiment of the invention does not limit the scope of the invention.

[0076] As can be seen, this optional embodiment can also obtain the target service instance returned by the service lookup method when the service call request is used to indicate a request to jump from the page of the first business component to the page of the second business component, and then implement the target business service protocol that the target service instance follows in order to return the business instance corresponding to the target business service protocol. Thus, based on the navigation route, the user jumps from the current page to the business page. This can improve the efficiency and accuracy of page retrieval in the page jump scenario while achieving low-coupling communication between components, thereby helping to improve the efficiency and accuracy of page jump.

[0077] In this embodiment of the invention, for example, the inter-component communication method can be applied to an inter-component communication architecture. Please refer to [link to relevant documentation]. Figure 3 , Figure 3 This is a schematic diagram of an inter-component communication architecture disclosed in an embodiment of the present invention. For example... Figure 3 As shown, the communication architecture between components can be developed using the Swift language, and this architecture can include multiple business components, UGService, UGServiceManager, and a service instance pool, where: Components A and C represent the business components of the caller, i.e., the first business component mentioned above. For example, component A can be a login component. Component B represents the protocol implementer, i.e., the second business component mentioned above. For example, component B can be a comic component. UGService is the middleware mentioned above, and UGServiceManager is the singleton service manager created by the middleware mentioned above. UGService can implement dynamic discovery functionality through UGServiceManager, i.e., dynamically scanning all service classes. The service instances obtained after UGServiceManager performs service registration for each service class, i.e., after performing the above initialization operations, can be stored in the service instance pool. Furthermore, if it is necessary to jump from the login component's page to the comic component's page, the comic service needs to be called through UGService to obtain the comic page. Specifically: after the login component detects successful login, since there is no dependency between the login component and the comic component, they need to communicate through UGService to achieve decoupling; by passing in the parameters corresponding to the comic service protocol and calling the service lookup method, it searches whether there is a target service instance in the service instance pool that conforms to the comic service protocol. If the target service instance exists, the comic service instance returned by the implementation of the comic service protocol, i.e., the comic page, is obtained, and the navigation route of the login component's login page is used to jump to the comic page.

[0078] Example 3 Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a communication device between components disclosed in an embodiment of the present invention. Figure 4 The described inter-component communication device may include one of a smart terminal, a smart device, a smart system, and a server, wherein the server is a local server or a cloud server, and this embodiment of the invention is not limited thereto; further, the device can be applied to an electronic device, the electronic device having an application installed thereon, the electronic device being communicatively connected to a network attached storage device, and the electronic device being able to access the network attached storage device through the application; further, the application may include an intermediate service component and multiple business components, each business component depending on the intermediate service component; optionally, the business components do not depend on each other, and this embodiment of the invention is not limited thereto; further optionally, the application may be an application running on the iOS platform, that is, the above-mentioned business components may be iOS components, and this embodiment of the invention is not limited thereto. Figure 4 As shown, the communication device 30 between the components may include: The lookup module 301 is used to, when a service call request of any first business component is detected, search for whether there is a target service instance in the service instance pool corresponding to the intermediate service component that conforms to the target service protocol corresponding to the service call request, through the service lookup method set by the intermediate service component; wherein, the target service instance is the service instance corresponding to the second business component, and the first business component and the second business component are respectively one of the business components; The service invocation module 302 is used to obtain the target service instance when a target service instance that conforms to the target service protocol corresponding to the service invocation request is found in the service instance pool corresponding to the intermediate service component, so as to invoke the business service requested by the service invocation request.

[0079] As can be seen, the apparatus described in the embodiments of the present invention can, when a service call request of the first business component is detected, search for whether there is a target service instance in the service instance pool that conforms to the corresponding target service protocol through the service search method set by the intermediate service component. If the target service instance is found, the target service instance is obtained to call the corresponding business service. By setting the intermediate service component for communication between business components, the business components can rely on the intermediate service component to reduce their dependence on other business components, thereby achieving low-coupling communication between business components. By providing a unified component communication mechanism, the communication mechanism between components is optimized. While improving the communication efficiency and flexibility between components, the independence between components is also improved, which helps to reduce the complexity of business component development and maintenance, thereby improving the development efficiency and maintainability of the application and improving the reliability of the application.

[0080] In an optional embodiment, such as Figure 5As shown, the device may further include: The scanning module 303 is used to dynamically scan at least one service class in the project corresponding to the application that meets the preset protocol conditions when the application starts, and store each service class in the service class list; each service class is used to implement one of the business components. The initialization module 304 is used to perform an initialization operation on each service class in the service class list based on the service protocol that the service class follows, so as to obtain the service instance corresponding to the service class. Storage module 305 is used to store service instances to the service instance pool; The service instance pool includes several service instances.

[0081] As can be seen, the apparatus described in this optional embodiment can dynamically scan service classes in the project that meet preset protocol conditions when the application starts, store the service classes in a service class list, initialize the service classes based on the service protocols they comply with, obtain corresponding service instances, and store the service instances in a service instance pool. This allows for the dynamic collection of service classes corresponding to business components without manually collecting and registering service instances of each service class to intermediate service components, thereby improving the scanning efficiency and comprehensiveness of service classes and thus improving the registration efficiency of service instances. Furthermore, by storing service instances in a service instance pool after instantiating service classes, it is beneficial to centrally manage service instances and facilitate repeated calls to service instances, thereby improving the management efficiency of service instances and the response efficiency of service calls, and further improving the communication efficiency between components.

[0082] In this optional embodiment, the specific method by which the scanning module 303 dynamically scans the application's corresponding project to find at least one service class that meets the preset protocol conditions may include: Scan the project corresponding to the application to obtain all classes defined in the project; For each class, when traversing to that class, the class name is extracted from the class identifier corresponding to that class based on a predefined naming format; Based on the class name of each class, at least one candidate class that matches the determined target name format is selected from all classes; Select at least one service class from all candidate classes that conforms to a predefined standard service protocol.

[0083] As can be seen, the apparatus described in this optional embodiment can also dynamically scan all classes defined in the project corresponding to the application, extract the class name from the class identifier corresponding to each class, filter at least one candidate class whose class name matches the determined target name format from all classes, and then filter at least one service class that conforms to the predefined standard service protocol from all candidate classes. This can improve the efficiency and comprehensiveness of dynamic scanning of classes corresponding to the application, while improving the efficiency and accuracy of filtering classes that conform to the standard service protocol. It can realize the dynamic collection of service classes that conform to the standard service protocol, thereby improving the reliability of service classes stored in the service class list and the reliability of service instances stored in the service instance pool.

[0084] In this optional embodiment, the specific method by which the scanning module 303 filters at least one candidate class that matches the determined target name format from all classes based on the class name of each class may include: For each class, determine whether the class name contains the identified target string; the target string is associated with the target identifier corresponding to the application, and the target string includes at least one character; For each class, if it is determined that the class name contains the target string, the class is identified as a candidate class.

[0085] As can be seen, the apparatus described in this optional embodiment can also determine whether the class name of each class contains a target string associated with the target identifier corresponding to the application. If it is determined that the class name contains a target string, the class is identified as a candidate class, thereby efficiently filtering non-developer-created types (such as third-party classes) from all scanned classes, improving the filtering efficiency for all scanned classes, and thus further improving the filtering efficiency of classes that comply with standard service agreements.

[0086] In this optional embodiment, each service class can optionally be created in the following way: Configure the service class to conform to a predefined standard service protocol, and configure the service class to return the service instance corresponding to the service class when implementing the standard service protocol; Configure the service instance corresponding to this service class to conform to one of the predefined business service protocols, and configure the service instance to return the business instance corresponding to the business service protocol when implementing the business service protocol.

[0087] As can be seen, the apparatus described in this optional embodiment can also create a service class by first setting the service class to conform to a standard service protocol, and then setting the service instance corresponding to the service class to conform to one of the predefined business service protocols. In order to return the business instance corresponding to the business service protocol when implementing the business service protocol, the intermediate service component can easily scan and register the service instance of the service class to the service instance pool when the service class is set to conform to the standard service protocol. This is beneficial for scanning all service classes more accurately. Furthermore, by setting the service class to conform to the business service protocol, it is beneficial for calling the business instance corresponding to the service class more efficiently. This is beneficial for improving the response efficiency and accuracy of service calls, and further beneficial for improving the communication efficiency and accuracy between components.

[0088] In this optional embodiment, each service protocol may be defined in the following ways: The protocol name of the service protocol is determined according to the pre-defined protocol naming conventions and the business component to which the service protocol belongs; Based on the protocol name, create a protocol file in the intermediate service component to define the business service protocol; Define the access control modifier corresponding to the business service protocol in the protocol file as public access, so as to define the business service protocol as a public protocol; The business service agreement defines the implementation method of the business service agreement; wherein, the implementation method includes the business parameters that need to be passed in and / or the abstract parameters that need to be returned.

[0089] As can be seen, the apparatus described in this optional embodiment can also determine the protocol name of the business service protocol according to the pre-set protocol naming convention and the business component to which the business service protocol belongs, so as to create a protocol file in the intermediate service component to define the business service protocol based on the protocol name, define the access control modifier corresponding to the business service protocol as public access, and define the implementation method corresponding to the business service protocol. This can improve the accuracy and reliability of the definition of the business service protocol, thereby enabling various components in the application to reference and comply with the business service protocol more efficiently and accurately, and further improve the communication efficiency and accuracy between components.

[0090] In this optional embodiment, the target service protocol may optionally include a standard service protocol and a target business service protocol; the target business service protocol may be one of the business service protocols. The specific method by which the service invocation module 302 obtains the target service instance and invokes the business service requested by the service invocation request may include: When a service call request is used to indicate a jump from a page of a first business component to a page of a second business component, the target business service protocol is implemented based on the target service instance to return the business instance corresponding to the target business service protocol; the business instance includes a business page, and the business page belongs to one of the pages of the second business component; Based on the navigation route corresponding to the first business component, the user is redirected from the current page of the first business component to the business page.

[0091] As can be seen, the apparatus described in this optional embodiment can also obtain the target service instance returned by the service lookup method when a service call request is used to indicate a request to jump from the page of the first business component to the page of the second business component, and then implement the target business service protocol followed by the target service instance to return the business instance corresponding to the target business service protocol. Thus, based on the navigation route, the user jumps from the current page to the business page. This can improve the page acquisition efficiency and page acquisition accuracy in the page jump scenario while achieving low-coupling communication between components, thereby helping to improve the efficiency and accuracy of page jump.

[0092] Example 4 Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. For example... Figure 6 As shown, the electronic device 40 may include: Memory 401 storing executable program code; Processor 402 coupled to memory 401; The processor 402 calls the executable program code stored in the memory 401 to execute some or all of the steps in the inter-component communication method described in Embodiment 1 or Embodiment 2 of the present invention.

[0093] Example 5 This invention discloses an inter-component communication system. Please refer to [link / reference]. Figure 7 , Figure 7 This is a schematic diagram of the structure of a communication system between components disclosed in an embodiment of the present invention. Figure 7 As shown, the inter-component communication system includes the inter-component communication device 30 described in Embodiment 3 of the present invention, and a network-attached storage device 50 communicatively connected to the inter-component communication device 30; wherein, the inter-component communication device 30 utilizes an intermediate service component to implement cross-component call for business services according to the inter-component communication method described in Embodiment 1 or Embodiment 2 of the present invention, so as to realize inter-component communication; or, In this embodiment of the invention, as another optional implementation, please refer to [link / reference needed]. Figure 8 , Figure 8 This is a schematic diagram of another inter-component communication system disclosed in an embodiment of the present invention. Figure 8 As shown, the inter-component communication system includes an electronic device 40 as described in Embodiment 4 of the present invention, and a network-attached storage device 50 communicatively connected to the electronic device 40; wherein, the electronic device 40 utilizes an intermediate service component to implement cross-component call for business services according to the inter-component communication method described in Embodiment 1 or Embodiment 2 of the present invention, so as to realize inter-component communication.

[0094] Example 6 This invention discloses a computer storage medium storing computer instructions. When these computer instructions are invoked, they are used to execute some or all of the steps in the inter-component communication method described in Embodiment 1 or Embodiment 2 of this invention.

[0095] Example 7 This invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps in the inter-component communication method described in Embodiment 1 or Embodiment 2.

[0096] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0097] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0098] Finally, it should be noted that the communication method, apparatus, electronic device, and system between components disclosed in the embodiments of the present invention are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A communication method between components, characterized in that, The method is applied to an electronic device, which has an application installed and is communicatively connected to a network-attached storage device (NAT). The electronic device can access the NAT via the application. The application includes an intermediate service component and multiple service components, each of which depends on the intermediate service component. The method includes: When a service call request from any first business component is detected, the service lookup method set by the intermediate service component is used to search whether there is a target service instance in the service instance pool corresponding to the intermediate service component that conforms to the target service protocol corresponding to the service call request; wherein, the target service instance is a service instance corresponding to the second business component, and the first business component and the second business component are each one of the business components; When a target service instance that conforms to the target service protocol corresponding to the service call request is found in the service instance pool corresponding to the intermediate service component, the target service instance is obtained to call the business service requested by the service call request.

2. The inter-component communication method according to claim 1, characterized in that, The method further includes: When the application starts, it dynamically scans at least one service class in the project corresponding to the application that meets the preset protocol conditions, and stores each service class in a service class list; each service class is used to implement one of the business components. For each service class in the service class list, based on the service protocol followed by the service class, an initialization operation is performed on the service class to obtain the service instance corresponding to the service class, and the service instance is stored in the service instance pool; The service instance pool includes several service instances.

3. The inter-component communication method according to claim 2, characterized in that, The dynamic scanning of the application's corresponding project to identify at least one service class that meets preset protocol conditions includes: Scan the project corresponding to the application to obtain all classes defined in the project; For each of the aforementioned classes, when traversing to that class, the class name is extracted from the class identifier corresponding to that class based on a predefined naming format; Based on the class name of each class, at least one candidate class whose class name matches the determined target name format is selected from all the classes; Select at least one service class from all the candidate classes that conforms to a predefined standard service protocol.

4. The inter-component communication method according to claim 3, characterized in that, The step of filtering at least one candidate class whose class name matches the determined target name format from all the classes based on the class name of each class includes: For each class, determine whether the class name contains the determined target string; the target string is associated with the target identifier corresponding to the application, and the target string includes at least one character; For each of the aforementioned classes, when it is determined that the class name contains the target string, the class is identified as a candidate class.

5. The inter-component communication method according to any one of claims 2-4, characterized in that, Each of the aforementioned service classes is created in the following manner: Configure the service class to conform to a predefined standard service protocol, and configure the service class to return a service instance corresponding to the service class when implementing the standard service protocol; Configure the service instance corresponding to this service class to comply with one of the predefined business service protocols, and configure the service instance to return the business instance corresponding to the business service protocol when implementing the business service protocol.

6. The inter-component communication method according to claim 5, characterized in that, Each of the aforementioned service protocols is defined in the following manner: The protocol name of the service protocol is determined according to the pre-defined protocol naming conventions and the business component to which the service protocol belongs; Based on the protocol name, a protocol file for defining the business service protocol is created in the intermediate service component; In the protocol file, the access control modifier corresponding to the service protocol is defined as public access, so that the service protocol is defined as a public protocol; The business service agreement defines the implementation method of the business service agreement; wherein, the implementation method includes the business parameters that need to be passed in and / or the abstract parameters that need to be returned.

7. The inter-component communication method according to claim 5, characterized in that, The target service agreement includes the standard service agreement and the target business service agreement; the target business service agreement is one of the aforementioned business service agreements. The step of obtaining the target service instance to invoke the business service requested by the service invocation request includes: When the service call request is used to indicate a request to jump from the page of the first business component to the page of the second business component, the target service instance returned by the service lookup method is obtained; Based on the target service instance, the target business service protocol that the target service instance conforms to is implemented to return the business instance corresponding to the target business service protocol; the business instance includes a business page, and the business page belongs to one of the pages of the second business component; Based on the navigation route corresponding to the first business component, the user is redirected from the current page of the first business component to the business page.

8. A communication device between components, characterized in that, The device is used in an electronic device, which has an application installed thereon. The electronic device is communicatively connected to a network-attached storage device (NAT), and the electronic device can access the NAT through the application. The application includes an intermediate service component and multiple service components, each of which depends on the intermediate service component. The device includes: The lookup module is used to, when a service call request of any first business component is detected, use the service lookup method set by the intermediate service component to look up whether there is a target service instance in the service instance pool corresponding to the intermediate service component that conforms to the target service protocol corresponding to the service call request; wherein, the target service instance is a service instance corresponding to the second business component, and the first business component and the second business component are respectively one of the business components; The service invocation module is used to obtain the target service instance when a target service instance that conforms to the target service protocol corresponding to the service invocation request is found in the service instance pool corresponding to the intermediate service component, so as to invoke the business service requested by the service invocation request.

9. An electronic device, characterized in that, The electronic device includes: Memory containing executable program code; A processor coupled to the memory; The processor invokes the executable program code stored in the memory to execute the inter-component communication method as described in any one of claims 1-7.

10. A communication system between components, characterized in that, The system includes an inter-component communication device as described in claim 8, and a network-attached storage device communicatively connected to the inter-component communication device; wherein the inter-component communication device utilizes an intermediate service component to implement cross-component invocation of business services according to the inter-component communication method as described in any one of claims 1-7, thereby realizing inter-component communication; or, The system includes the electronic device as described in claim 9, and a network-attached storage device communicatively connected to the electronic device; wherein the electronic device utilizes an intermediate service component to implement cross-component invocation of business services according to the inter-component communication method as described in any one of claims 1-7, thereby realizing inter-component communication.

11. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked, are used to execute the inter-component communication method as described in any one of claims 1-7.