A RPC communication service registration and discovery method and system based on application-level service model

By adopting an application-level service model in RPC communication, using application names to locate services and calculate the interface set version number, the problems of data redundancy and high network transmission occupation in the prior art are solved, and more efficient service registration and discovery are achieved.

CN119743516APending Publication Date: 2025-04-01CHINA CITIC BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411784428.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the prior art, the registration center service model fails to fully consider the relationship mapping between the application and the RPC service interface and the service instance IP in the RPC scenario, resulting in data redundancy and excessive data usage of network transmission.

Method used

The RPC communication service registration and discovery method based on the application-level service model is adopted, and the service positioning is performed by the application name as a keyword. The interface collection version number is calculated to manage the changes in the application interface data, and the application name, RPC interface list and interface collection version number are stored in the registration center.

Benefits of technology

There is no need to establish a mapping relationship between the application and RPC interface separately, which reduces network transmission burden, improves processing efficiency and system response speed, and reduces data redundancy and repeated reporting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743516A_ABST
    Figure CN119743516A_ABST
Patent Text Reader

Abstract

The present invention relates to a RPC communication service registration and discovery method and system based on an application-level service model, specifically comprising: defining an application-level service model including an application object, an interface metadata object and an application registration instance object, wherein the interface metadata object includes an RPC interface list published by an application system and a subscribed RPC interface list; after the RPC application is started, the RPC framework scans the interface list, and calculates the interface set version number according to the application name, the published RPC interface list and the subscribed RPC interface list, checks whether the registration center has interface data with the same application name and interface set version number, and if not, reports the relevant information to the registration center and stores it, and returns the relationship between the subscribed interface and the application publisher. Therefore, there is no need to establish a mapping relationship separately, and the application interface data changes are managed by the version number, which can avoid data redundancy and repeated reporting, reduce the network transmission burden, and improve the processing efficiency and system response speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed systems and network communication technology, and specifically proposes an RPC communication service registration and discovery method and system based on an application-level service model. The application-level service model can be used to quickly locate the required service without the need to establish a separate mapping relationship, thereby reducing the network transmission burden and improving processing efficiency and system response speed. Background Art

[0002] In the distributed system architecture, the service discovery mechanism is the core component of implementing service governance and architecture. The mechanism involves three key roles: service provider, service consumer and registration center. The service provider, that is, the server application, runs on the server and provides specific services. It registers data such as IP address, application name, and RPC interface to the registration center. When the service consumer, that is, the client application, needs to call the service remotely, it queries the registration center for the service provider address and caches the acquired information to local storage. The registration center, as the communication center of the distributed architecture, stores the mapping table between the service name and the service provider IP address, supports service consumers to query services, and dynamically perceives changes in the service provider IP. The service discovery mechanism based on RPC communication is usually divided into two types of interface-level granularity and application-level granularity, which organize service data using RPC service interface and service application as key values ​​respectively.

[0003] Although the existing service discovery mechanism plays an important role in distributed systems, the following technical problems still exist in the existing technology. First, the existing registration center service model fails to fully consider the relationship mapping between the application and the RPC service interface and the service instance IP in the RPC scenario, and fails to fully adapt to the RPC model. Secondly, if an interface-granular service model is adopted, the amount of data in the registration center is proportional to the number of service interfaces and service instances of the application, resulting in data redundancy and network transmission data occupancy when the application is first registered or restarted. Finally, the existing registration center usually uses interface-granularity serial publishing or subscription service interfaces, which is inefficient and has poor performance. In addition, for different server nodes of the same application, the repeated transmission of the service interface causes transmission data redundancy and occupies network bandwidth.

[0004] Therefore, it is necessary to propose a new service discovery data model and service registration and discovery method, which can accurately locate service interfaces and service instances by using application names as keywords. This eliminates the need to build a separate system to maintain the mapping relationship between applications and RPC interfaces, improves the efficiency of dynamic service discovery between application services, reduces the size of network transmission data, and reduces network bandwidth usage. Summary of the invention

[0005] To address the deficiencies of the prior art, the present invention proposes a RPC communication service registration and discovery method and system based on an application-level service model.

[0006] To achieve the above objectives, the technical solutions adopted by the present invention include:

[0007] A method for registering and discovering RPC communication services based on an application-level service model, comprising:

[0008] S1. Define an application-level service model, wherein the application-level service model includes an application object, an interface metadata object, and an application registration instance object, wherein the interface metadata object includes a first RPC interface list and a second RPC interface list, wherein the first RPC interface list is an RPC interface list published by the application system, and the second RPC interface list is a subscription RPC interface list;

[0009] S2. Start the RPC application, and the RPC framework scans the first RPC interface list and the second RPC interface list;

[0010] S3. Calculate the interface set version number based on the application name, the first RPC interface list and the second RPC interface list;

[0011] S4. Traverse the registration center. If there is no interface data with the same application name and interface set version number, the application name, the first RPC interface list, the second RPC interface list, and the interface set version number are reported to the registration center and stored. The relationship between the subscription interface and the application publisher is returned according to the second RPC interface list;

[0012] S5. The application system initiates a service registration or subscription request. The service registration request is used to associate the registered instance with the current application name. The service subscription request is used to obtain the subscribed RPC interface, the application name that provides the RPC interface, and its instance list information.

[0013] Further, the calculation of the interface set version number in step S3 specifically includes:

[0014] A hash algorithm is used to perform a hash operation on the application name, the first RPC interface list, and the second RPC interface list to obtain a hash value, and the hash value is combined with the application name to form the interface set version number.

[0015] Further, in step S4, if interface data with the same application name and interface set version number exists, the reporting operation is not performed, and the existing interface data information is returned.

[0016] Further, step S5 also includes:

[0017] A heartbeat mechanism is established between the application system and the registration center to maintain the connection status between the application system and the registration center.

[0018] Furthermore, the heartbeat mechanism includes: regularly sending heartbeat requests to the registration center, the registration center updates the status information of the corresponding application system, and the heartbeat request includes the IP address, port number and interface set version number of the application system, as well as the health status information of the application system.

[0019] Furthermore, the heartbeat mechanism also includes: when the registration center does not receive a heartbeat request for more than a preset time threshold, the state of the application system is automatically marked as unhealthy and removed from the registration center.

[0020] In addition, the present invention also relates to an RPC communication service registration and discovery system based on an application-level service model, characterized in that it includes:

[0021] An application-level service model definition module, used to define an application-level service model, wherein the application-level service model includes an application object, an interface metadata object, and an application registration instance object, wherein the interface metadata object includes a first RPC interface list and a second RPC interface list, wherein the first RPC interface list is an RPC interface list published by the application system, and the second RPC interface list is a subscription RPC interface list;

[0022] An RPC application startup and scanning module, used for starting an RPC application, and for the RPC framework to scan the first RPC interface list and the second RPC interface list;

[0023] An interface set version number calculation module, used to calculate the interface set version number according to the application name, the first RPC interface list and the second RPC interface list;

[0024] A registration center interaction module, used to traverse the registration center, and if there is no interface data with the same application name and interface set version number, report the application name, the first RPC interface list, the second RPC interface list, and the interface set version number to the registration center and store them, and return the relationship between the subscription interface and the application publisher according to the second RPC interface list;

[0025] The service registration and subscription module is used by the application system to initiate service registration or subscription requests. The service registration request is used to associate the registered instance with the current application name. The service subscription request is used to obtain the subscribed RPC interface, the application name that provides the RPC interface, and its instance list information.

[0026] Furthermore, the service registration and subscription module is also used to: establish a heartbeat mechanism between the application system and the registration center to maintain the connection status between the application system and the registration center.

[0027] In addition, the present invention also relates to an electronic device, characterized in that it comprises a processor and a memory;

[0028] The memory is used to store operation instructions;

[0029] The processor is used to execute the above method by calling the operation instruction.

[0030] In addition, the present invention also relates to a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and the computer program implements the above method when executed by a processor.

[0031] The present invention discloses a RPC communication service registration and discovery method and system based on an application-level service model, comprising the following steps: defining an application-level service model including an application object, an interface metadata object and an application registration instance object, wherein the interface metadata object includes an RPC interface list published by an application system and a subscribed RPC interface list; after the RPC application is started, the RPC framework scans the interface list, and calculates the interface set version number according to the application name, the published RPC interface list and the subscribed RPC interface list, checks whether the registration center has interface data with the same application name and interface set version number, and if not, reports the relevant information to the registration center and stores it, and returns the relationship between the subscribed interface and the application publisher. The application system initiates a service registration or subscription request to establish an association or obtain information, and also establishes a heartbeat mechanism to maintain the connection state, the content of the heartbeat request and the response mechanism of the registration center to the heartbeat request. Therefore, the technical solution uses the application name as a keyword to locate the service through the application-level service model, so as not to establish a mapping relationship separately, manages the application interface data changes through the version number, and can avoid data redundancy and repeated reporting for the existing interface data, reduces the network transmission burden, and improves the processing efficiency and system response speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A schematic diagram of an application-level service model provided for an embodiment of the present application;

[0033] Figure 2 A flowchart of an RPC communication service registration and discovery method based on an application-level service model provided in an embodiment of the present application;

[0034] Figure 3 A schematic diagram of the structure of an RPC communication service registration and discovery system based on an application-level service model provided in an embodiment of the present application;

[0035] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present invention.

[0037] Those skilled in the art can understand that, unless otherwise stated, the singular forms "one", "an", "said" and "the" used herein may also include plural forms, and the "first", "second", etc., are only used to distinguish and define objects for the purpose of introducing the scheme clearly, and do not limit the objects themselves. Of course, the objects defined by "first" and "second" may be the same terminal, device, user, etc., or the same type of terminal, device and user. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0038] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0039] The existing service registration and discovery methods based on RPC communication specifically include:

[0040] Service registration: When the server application starts, the IP address and service information are registered to the registration center;

[0041] Service discovery: When the consumer application starts, it initiates a service discovery request to the registration center according to the demand. The registration center returns the corresponding service provider list, and the consumer application stores the service provider list data;

[0042] Service call: The client application establishes a remote connection based on the IP address list obtained from the registration center and selects a server address for remote call.

[0043] There are two types of service discovery mechanisms in the RPC scenario, namely interface-level granularity and application-level granularity.

[0044] Interface-level service discovery uses the RPC service interface as the key (service ID) and the application system's server instance list as the value. When a service consumer subscribes to a service, it uses the service interface as a query condition to obtain the service instance.

[0045] For example, application A contains four service interfaces and is deployed on three server instances. The service organization is as follows. Application B needs to obtain the service instance using the RPC interface com.abc.base.user.api0 as the subscription condition:

[0046] com.abc.base.user.api0->[127.0.0.1 8888],[127.0.0.2 8888],[127.0.0.38888]

[0047] com.abc.base.user.api1->[127.0.0.1 8888],[127.0.0.2 8888],[127.0.0.38888]

[0048] com.abc.base.user.api2->[127.0.0.1 8888],[127.0.0.2 8888],[127.0.0.38888]

[0049] com.abc.base.user.api3->[127.0.0.1 8888],[127.0.0.2 8888],[127.0.0.38888]

[0050] Application-level service discovery uses the RPC application as the key (service ID) and the application system's server instance list as the value. When a service consumer subscribes to a service, the service instance is obtained by using the application name as the query condition. For example, if application A contains 4 service interfaces and the application is deployed in 3 server instances, the service organization is as follows: application B needs to use the RPC application name A as the subscription condition to obtain the service instance. From the application-level scenario, it can be seen that the consumer application needs to confirm the mapping relationship between the service application and the RPC service interface when discovering the service:

[0051] A->[127.0.0.1 8888],[127.0.0.2 8888],[127.0.0.3 8888]

[0052] A->[com.abc.base.user.api0],[com.abc.base.user.api1],[com.abc.base.user.api2],[com.abc.base.user.api3].

[0053] Therefore, the existing registration center service model fails to fully consider the relationship mapping between applications and RPC service interfaces and service instance IPs in RPC scenarios, fails to fully adapt to the RPC model, and has problems such as data redundancy and excessive network transmission data usage.

[0054] like Figure 1 The figure shows the application-level service model in this case. The application-level service model is application-centric. On the right is the RPC interface collection data of the application system, including the published RPC interface service list (first RPC interface list) and the subscribed interface service list (second RPC interface list). The RPC interface can be queried through the application name. According to the application interface data, the interface collection version is calculated to manage the application interface data changes; on the left is the application registration instance object. The instance includes application name, interface collection version, IP, port and other attributes. The registered instance can be queried through the application name, and the collection version can be queried through the registered instance, and then the RPC interface service list and subscribed RPC service interface list published by the current instance can be obtained. The subscriber application name list can be queried through the published RPC service interface, and the published application name can be queried through the subscribed RPC interface.

[0055] Based on the above application-level service model, we have developed Figure 2 The RPC communication service registration and discovery method based on the application-level service model is characterized by comprising:

[0056] S1. Define an application-level service model, wherein the application-level service model includes an application object, an interface metadata object, and an application registration instance object, wherein the interface metadata object includes a first RPC interface list and a second RPC interface list, wherein the first RPC interface list is an RPC interface list published by the application system, and the second RPC interface list is a subscription RPC interface list;

[0057] S2. Start the RPC application, and the RPC framework scans the first RPC interface list and the second RPC interface list;

[0058] S3. Calculate the interface set version number based on the application name, the first RPC interface list and the second RPC interface list;

[0059] Specifically, the calculation interface set version number includes:

[0060] The following hashing algorithm is used:

[0061] revision=hash(appName,PubList,SubList)+appName

[0062] A hash operation is performed on the application name, the first RPC interface list, and the second RPC interface list to obtain a hash value, and the hash value is combined with the application name to form the interface set version number.

[0063] S4. Traverse the registration center. If there is no interface data with the same application name and interface set version number, report the application name, the first RPC interface list, the second RPC interface list, and the interface set version number to the registration center and store them. Return the relationship between the subscription interface and the application publisher based on the second RPC interface list.

[0064] Specifically, if there is interface data with the same application name and interface set version number, the reporting operation is not performed, and the existing interface data information is returned;

[0065] In this case, an application-level service model is set up. The registered instance can be queried through the application name, and the collection version can be queried through the registered instance, so as to obtain the RPC interface service list and the subscribed RPC service interface list published by the current instance. The subscriber application name list can be queried through the published RPC service interface, and the published application name can be queried through the subscribed RPC interface. Therefore, there is no need to build a separate system to maintain the mapping relationship between the application and the RPC interface, and the same RPC interface list is only reported once, which reduces the size of network transmission data, reduces network bandwidth usage, and improves service registration and discovery efficiency.

[0066] S5. The application system initiates a service registration or subscription request. The service registration request is used to associate the registered instance with the current application name. The service subscription request is used to obtain the subscribed RPC interface, the application name that provides the RPC interface, and its instance list information.

[0067] Specifically, a heartbeat mechanism is established between the application system and the registration center to maintain the connection status between the application system and the registration center;

[0068] Sending a heartbeat request to the registration center at regular intervals, the registration center updates the status information of the corresponding application system, the heartbeat request includes the IP address, port number and interface set version number of the application system, and the health status information of the application system;

[0069] When the registration center does not receive a heartbeat request for more than a preset time threshold, for example, 3 times, the status of the application system is automatically marked as unhealthy and removed from the registration center.

[0070] By establishing a heartbeat mechanism, the health status of the application system and the registration center is maintained, ensuring the reliability and stability of the service. At the same time, since the heartbeat request only contains necessary parameters, the network bandwidth usage is further reduced.

[0071] In addition, another aspect is also related to an RPC communication service registration and discovery system based on an application-level service model, whose structure is as follows: Figure 3 As shown, including:

[0072] An application-level service model definition module 301 is used to define an application-level service model, wherein the application-level service model includes an application object, an interface metadata object, and an application registration instance object, wherein the interface metadata object includes a first RPC interface list and a second RPC interface list, wherein the first RPC interface list is an RPC interface list published by the application system, and the second RPC interface list is a subscription RPC interface list;

[0073] An RPC application startup and scanning module 302, used for starting an RPC application and scanning the first RPC interface list and the second RPC interface list by an RPC framework;

[0074] An interface set version number calculation module 303, configured to calculate an interface set version number according to an application name, the first RPC interface list, and the second RPC interface list;

[0075] The registration center interaction module 304 is used to traverse the registration center, and if there is no interface data with the same application name and interface set version number, the application name, the first RPC interface list, the second RPC interface list, and the interface set version number are reported to the registration center and stored, and the relationship between the subscription interface and the application publisher is returned according to the second RPC interface list;

[0076] The service registration and subscription module 305 is used for the application system to initiate a service registration or subscription request. The service registration request is used to associate the registered instance with the current application name. The service subscription request is used to obtain the subscribed RPC interface, the application name providing the RPC interface and its instance list information.

[0077] Further, the interface set version number calculation module 303 is specifically used for:

[0078] A hash algorithm is used to perform a hash operation on the application name, the first RPC interface list, and the second RPC interface list to obtain a hash value, and the hash value is combined with the application name to form the interface set version number.

[0079] Furthermore, the registration center interaction module 304 is also used for:

[0080] If interface data with the same application name and interface set version number exists, the reporting operation will not be performed and the existing interface data information will be returned.

[0081] Furthermore, the service registration and subscription module 305 is also used for:

[0082] A heartbeat mechanism is established between the application system and the registration center to maintain the connection status between the application system and the registration center; the heartbeat mechanism includes: regularly sending heartbeat requests to the registration center, the registration center updates the status information of the corresponding application system, the heartbeat request includes the IP address, port number and interface set version number of the application system, and the health status information of the application system; the heartbeat mechanism also includes: when the registration center does not receive a heartbeat request for more than a preset time threshold, the status of the application system is automatically marked as unhealthy and removed from the registration center.

[0083] By using this system, the above method can be executed and the corresponding technical effects can be achieved.

[0084] An embodiment of the present invention further provides an electronic device for executing the above method, as an implementation device of the method, comprising a processor and a memory;

[0085] A memory, used for storing operation instructions;

[0086] The processor is used to execute an RPC communication service registration and discovery method based on an application-level service model provided in any embodiment of the present application by calling an operation instruction.

[0087] As an example, Figure 4 A schematic diagram of the structure of an electronic device applicable to an embodiment of the present application is shown, and the electronic device 400 includes: a processor 401 and a memory 403. The processor 401 and the memory 403 are connected, such as being connected through a bus 402. Optionally, the electronic device 400 may also include a transceiver 404. It should be noted that in actual applications, the transceiver 404 is not limited to one. It is understandable that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the specific structure of the electronic device 400. In other embodiments of the present application, the electronic device 400 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. Optionally, the electronic device may also include a display screen 405 for displaying images, or receiving user operation instructions when necessary.

[0088] The processor 401 is applied in the embodiment of the present application to implement the method shown in the above method embodiment. The transceiver 404 may include a receiver and a transmitter. The transceiver 404 is applied in the embodiment of the present application to implement the function of the electronic device of the embodiment of the present application communicating with other devices when executed.

[0089] Processor 401 may be a CPU (Central Processing Unit), a general purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 401 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0090] The processor 401 may also include one or more processing units, for example: the processor 401 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (Neural-network Processing Unit, NPU), etc. Different processing units can be independent devices or integrated into one or more processors. Among them, the controller can be the nerve center and command center of the electronic device 400. The controller can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. A memory can also be set in the processor 401 for storing instructions and data. In some embodiments, the memory in the processor 401 is a cache memory. The memory can save instructions or data that the processor 401 has just used or circulated.

[0091] Processor 401 can run the RPC communication service registration and discovery method based on the application-level service model provided in the embodiment of the present application. Processor 401 may include different devices. For example, when integrating a CPU and a GPU, the CPU and the GPU can cooperate to execute the RPC communication service registration and discovery method based on the application-level service model provided in the embodiment of the present application. Part of the algorithm is executed by the CPU, and the other part of the algorithm is executed by the GPU to obtain faster processing efficiency.

[0092] The bus 402 may include a path to transmit information between the above components. The bus 402 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 402 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0093] The memory 403 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or may include a high-speed random access memory, or may include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.

[0094] Optionally, the memory 403 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 401. The processor 401 is used to execute the application code stored in the memory 403 to implement the RPC communication service registration and discovery method based on the application-level service model provided in any embodiment of the present application.

[0095] The memory 403 can be used to store computer executable program codes, which include instructions. The processor 401 executes various functional applications and data processing of the electronic device 400 by running the instructions stored in the memory 403. The memory 403 may include a program storage area and a data storage area. Among them, the program storage area may store the code of the operating system, application program, etc. The data storage area may store data created during the use of the electronic device 400 (such as images, videos, etc. collected by the camera application), etc.

[0096] The memory 403 may also store one or more computer programs corresponding to the RPC communication service registration and discovery method based on the application-level service model provided in the embodiment of the present application. The one or more computer programs are stored in the above-mentioned memory 403 and are configured to be executed by the one or more processors 401, and the one or more computer programs include instructions, which can be used to execute each step in the above-mentioned corresponding embodiment.

[0097] Of course, the code of the RPC communication service registration and discovery method based on the application-level service model provided in the embodiment of the present application can also be stored in an external memory.

[0098] The display screen 405 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 400 may include 1 or N display screens 405, where N is a positive integer greater than 1. The display screen 405 may be used to display information input by a user or information provided to a user and various graphical user interfaces (GUIs). For example, the display screen 405 may display photos, videos, web pages, or files, etc.

[0099] The electronic device provided in the embodiment of the present application is applicable to any embodiment of the above method. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, which will not be repeated here.

[0100] An embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps in the method in the above embodiment, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps in the method in the above embodiment are implemented.

[0101] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product 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.

[0102] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.

[0103] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1The steps of the functions specified in a box or multiple boxes. Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0105] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A RPC communication service registration and discovery method based on an application-level service model, characterized in that: include: S1. Define an application-level service model, wherein the application-level service model includes an application object, an interface metadata object, and an application registration instance object, wherein the interface metadata object includes a first RPC interface list and a second RPC interface list, wherein the first RPC interface list is an RPC interface list published by the application system, and the second RPC interface list is a subscription RPC interface list; S2. Start the RPC application, and the RPC framework scans the first RPC interface list and the second RPC interface list; S3. Calculate the interface set version number based on the application name, the first RPC interface list and the second RPC interface list; S4. Traverse the registration center. If there is no interface data with the same application name and interface set version number, the application name, the first RPC interface list, the second RPC interface list, and the interface set version number are reported to the registration center and stored. The relationship between the subscription interface and the application publisher is returned according to the second RPC interface list; S5. The application system initiates a service registration or subscription request. The service registration request is used to associate the registered instance with the current application name. The service subscription request is used to obtain the subscribed RPC interface, the application name that provides the RPC interface, and its instance list information.

2. The method according to claim 1, characterized in that Calculating the interface set version number in step S3 specifically includes: A hash algorithm is used to perform a hash operation on the application name, the first RPC interface list, and the second RPC interface list to obtain a hash value, and the hash value is combined with the application name to form the interface set version number.

3. The method according to claim 1, characterized in that In step S4, if interface data with the same application name and interface set version number exists, the reporting operation is not performed, and the existing interface data information is returned.

4. The method according to claim 1, characterized in that: Step S5 also includes: A heartbeat mechanism is established between the application system and the registration center to maintain the connection status between the application system and the registration center.

5. The method according to claim 4, characterized in that The heartbeat mechanism includes: regularly sending heartbeat requests to the registration center, the registration center updates the status information of the corresponding application system, and the heartbeat request contains the IP address, port number and interface set version number of the application system, as well as the health status information of the application system.

6. The method according to claim 5, characterized in that The heartbeat mechanism also includes: when the registration center does not receive a heartbeat request for more than a preset time threshold, the state of the application system is automatically marked as unhealthy and removed from the registration center.

7. An RPC communication service registration and discovery system based on an application-level service model, characterized in that: include: An application-level service model definition module, used to define an application-level service model, wherein the application-level service model includes an application object, an interface metadata object, and an application registration instance object, wherein the interface metadata object includes a first RPC interface list and a second RPC interface list, wherein the first RPC interface list is an RPC interface list published by the application system, and the second RPC interface list is a subscription RPC interface list; An RPC application startup and scanning module, used for starting an RPC application, and for the RPC framework to scan the first RPC interface list and the second RPC interface list; An interface set version number calculation module, used to calculate the interface set version number according to the application name, the first RPC interface list and the second RPC interface list; A registration center interaction module, used to traverse the registration center, and if there is no interface data with the same application name and interface set version number, report the application name, the first RPC interface list, the second RPC interface list, and the interface set version number to the registration center and store them, and return the relationship between the subscription interface and the application publisher according to the second RPC interface list; The service registration and subscription module is used by the application system to initiate service registration or subscription requests. The service registration request is used to associate the registered instance with the current application name. The service subscription request is used to obtain the subscribed RPC interface, the application name that provides the RPC interface, and its instance list information.

8. The system according to claim 7, characterized in that The service registration and subscription module is also used to establish a heartbeat mechanism between the application system and the registration center to maintain the connection status between the application system and the registration center.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store operation instructions; The processor is used to execute the method according to any one of claims 1 to 6 by calling the operation instruction.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.