CN114389988B - Remote procedure call method, device, equipment and medium based on network architecture - Google Patents

Remote procedure call method, device, equipment and medium based on network architecture

Info

Publication number
CN114389988B
CN114389988B CN202210037732.2A CN202210037732A CN114389988B CN 114389988 B CN114389988 B CN 114389988B CN 202210037732 A CN202210037732 A CN 202210037732A CN 114389988 B CN114389988 B CN 114389988B
Authority
CN
China
Prior art keywords
message
router
request
receiver
remote procedure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210037732.2A
Other languages
Chinese (zh)
Other versions
CN114389988A (en
Inventor
吉青松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Pingan Payment Technology Service Co Ltd
Original Assignee
Pingan Payment Technology Service Co Ltd
Filing date
Publication date
Application filed by Pingan Payment Technology Service Co Ltd filed Critical Pingan Payment Technology Service Co Ltd
Priority to CN202210037732.2A priority Critical patent/CN114389988B/en
Publication of CN114389988A publication Critical patent/CN114389988A/en
Application granted granted Critical
Publication of CN114389988B publication Critical patent/CN114389988B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to equipment monitoring and management in the operation and maintenance field, and provides a remote procedure call method, a device, equipment and a medium based on a network architecture. In addition, the invention also relates to a blockchain technology, and the third message can be stored in a blockchain node.

Description

Remote procedure call method, device, equipment and medium based on network architecture
Technical Field
The present invention relates to the field of operation and maintenance technologies, and in particular, to a method, an apparatus, a device, and a medium for remote procedure call based on a network architecture.
Background
In the original single application architecture, the application end (such as a client end) is mainly called in a three-level architecture mode, namely: front-end- > intermediate business logic layer- > database layer. However, as the service becomes more and more complex, the service develops into a multi-application public database, and the architecture causes the database to become larger and larger, which eventually becomes a bottleneck for service development, and continuous capacity expansion is required for the server of the database, but the database is a very expensive resource, so the cost of the capacity expansion manner is too high.
In addition, a large amount of data all fall into one library, so that more and more contents are stored in the database, a large amount of manpower is required to be consumed for maintenance, decoupling cannot be achieved on personnel, and the barriers to business development of enterprises are also increased.
In addition, in the conventional scheme, there is no unified calling mode among applications, and various problems such as redundancy of calling methods can also occur.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, apparatus, device, and medium for remote procedure call based on a network architecture, which aims to solve the problem of remote procedure call.
The remote procedure call method based on the network architecture is applied to a remote procedure call system, the remote procedure call system comprises a router and a plurality of application ends, the application ends are a requester and a receiver, and the remote procedure call method based on the network architecture comprises the following steps:
when detecting that an application end sends out a call request in the plurality of application ends, determining the detected application end as the requester;
The call request is sent to the request Fang Jiexi to obtain a request object of the requester as the receiver, and a first message is generated according to the receiver and the call request;
acquiring a pre-configured router list, and inquiring in the router list by utilizing the requesting party and the receiving party to obtain a target router;
The first message is sent to the target router by the requester, and the first message is recombined in the target router to obtain a second message;
The second message is sent to the receiver by the target router, and the second message is analyzed in the receiver to obtain configuration information;
Generating an instance on the receiver based on the configuration information, and calling a service party by using the instance to obtain a request result;
feeding back the request result from the receiver to the target router, and recombining the request result into a third message by the target router;
and returning the third message to the requester by the target router.
According to a preferred embodiment of the invention, the method further comprises:
When detecting that any application end requests to join the remote procedure call system, registering the any application end.
According to a preferred embodiment of the present invention, the generating a first message according to the receiving party and the call request includes:
Acquiring request content from the call request and acquiring the appointed format of the message between the receiver and the requester;
starting a pre-implanted processing class component in the receiver according to the call request;
And adopting the processing class component to assemble the request content into the first message based on the appointed format.
According to a preferred embodiment of the present invention, the generating, at the receiving side, an instance based on the configuration information includes:
Acquiring task parameters from the receiver based on the configuration information;
dynamically loading a service implementation class according to the task parameters;
And assembling the service implementation class to obtain the instance.
According to a preferred embodiment of the invention, the method further comprises:
Acquiring a thread adopted when the call request is sent out as a first thread;
After the first message is sent to the target router by the requester, freezing the first thread and releasing the resources of the first thread;
And restarting the first thread after returning the third message to the requester by the target router.
According to a preferred embodiment of the invention, the method further comprises:
after the first message is sent to the target router by the requester, monitoring whether the first thread is restarted within a preset time period;
Returning an interface access timeout when the first thread is not restarted within the preset duration; or alternatively
When the first thread is restarted within the preset duration, analyzing the third message to obtain an analysis result, detecting whether the analysis result is abnormal, returning the analysis result to the requesting party when the analysis result is not abnormal, or reporting the abnormality to a designated terminal when the analysis result is abnormal.
According to a preferred embodiment of the invention, the method further comprises:
and configuring the highest initiating request quantity and/or the highest receiving request quantity for the plurality of application ends.
A remote procedure call device based on a network architecture, which operates in a remote procedure call system, the remote procedure call system including a router and a plurality of application terminals, the plurality of application terminals being a requester and a receiver, the remote procedure call device based on the network architecture comprising:
A determining unit, configured to determine, when it is detected that an application terminal sends a call request from among the plurality of application terminals, the detected application terminal as the requester;
The generating unit is configured to obtain, at the request Fang Jiexi, the call request, and obtain a request object of the requester as the receiver, and generate a first packet according to the receiver and the call request;
The query unit is used for acquiring a pre-configured router list, and querying the router list by utilizing the requester and the receiver to obtain a target router;
The reorganization unit is used for sending the first message from the requesting party to the target router, reorganizing the first message in the target router and obtaining a second message;
the analyzing unit is used for sending the second message from the target router to the receiver and analyzing the second message in the receiver to obtain configuration information;
the calling unit is used for generating an instance on the basis of the configuration information at the receiving party and calling a service party by utilizing the instance to obtain a request result;
the reorganization unit is further configured to feed back the request result from the receiving side to the target router, and reorganize the request result into a third message by the target router;
and the return unit is used for returning the third message to the requester by the target router.
A computer device, the computer device comprising:
a memory storing at least one instruction; and
And the processor executes the instructions stored in the memory to realize the remote procedure call method based on the network architecture.
A computer-readable storage medium having stored therein at least one instruction for execution by a processor in a computer device to implement the network architecture-based remote procedure call method.
According to the technical scheme, the router is used as an interaction center at each application end of the remote procedure call system, and the router is used as an interaction center for the data interaction between the requesting party and the receiving party, so that the data are not required to be uniformly stored in one database to cause database burden, the remote procedure call is realized through a distributed network architecture, and the router is used for uniform call, so that the call method is unified, redundancy is avoided, and the management and the monitoring are convenient.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of the remote procedure call method based on the network architecture of the present invention.
FIG. 2 is a functional block diagram of a preferred embodiment of a remote procedure call device based on a network architecture of the present invention.
FIG. 3 is a schematic diagram of a computer device implementing a preferred embodiment of a remote procedure call method based on a network architecture.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of a preferred embodiment of a remote procedure call method based on a network architecture of the present invention. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs.
The remote procedure call method based on network architecture is applied to one or more computer devices, wherein the computer device is a device capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware of the computer device comprises, but is not limited to, a microprocessor, an Application SPECIFIC INTEGRATED Circuit (ASIC), a Programmable gate array (Field-Programmable GATE ARRAY, FPGA), a digital Processor (DIGITAL SIGNAL Processor, DSP), an embedded device and the like.
The computer device may be any electronic product that can interact with a user in a human-computer manner, such as a Personal computer, a tablet computer, a smart phone, a Personal digital assistant (Personal DIGITAL ASSISTANT, PDA), a game console, an interactive internet protocol television (Internet Protocol Television, IPTV), a smart wearable device, etc.
The computer device may also include a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network server, a server group composed of a plurality of network servers, or a Cloud based Cloud Computing (Cloud Computing) composed of a large number of hosts or network servers.
The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Wherein artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend, and expand human intelligence, sense the environment, acquire knowledge, and use knowledge to obtain optimal results.
Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
The network in which the computer device is located includes, but is not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.
The remote procedure call method based on the network architecture is applied to a remote procedure call system (Remote Procedure Call, RPC), and the remote procedure call system comprises a router and a plurality of application ends, wherein the application ends are a requester and a receiver.
And S10, when detecting that an application end sends out a call request in the plurality of application ends, determining the detected application end as the requester.
In this embodiment, the plurality of application ends perform the interaction between data with the router as the center, which is equivalent to forming a star-like network architecture.
In at least one embodiment of the invention, the method further comprises:
When detecting that any application end requests to join the remote procedure call system, registering the any application end.
By the implementation mode, any application end is directly registered as long as any application end is detected to request to join the remote procedure call system, so that the time consumption and the resource waste caused by increasing the operation burden of the system in actual call are avoided.
In this embodiment, the application ends belong to internal applications, and can communicate with each other without calling a gateway.
For example: the application end can be each application client end under one enterprise, and the like.
S11, in the call request of the request Fang Jiexi, a request object of the requester is obtained as the receiver, and a first message is generated according to the receiver and the call request.
In this embodiment, the manner of resolving the call request is not limited.
Further, after the call request is analyzed, an identification code corresponding to the request object can be obtained, and the receiver is determined according to the identification code corresponding to the request object.
In at least one embodiment of the present invention, the generating a first message according to the receiving party and the call request includes:
Acquiring request content from the call request and acquiring the appointed format of the message between the receiver and the requester;
starting a pre-implanted processing class component in the receiver according to the call request;
And adopting the processing class component to assemble the request content into the first message based on the appointed format.
The processing class component can be a jar packet, and the processing class component can be embedded in a corresponding terminal in advance for direct calling.
By the embodiment, the corresponding message can be generated at the requesting party according to the requested content and the format requirements of the requesting party and the receiving party, so that the effective transmission of the message can be carried out later.
S12, obtaining a pre-configured router list, and inquiring in the router list by utilizing the requesting party and the receiving party to obtain a target router.
In at least one embodiment of the invention, the router list is used to store all routers connected to a given interface.
Further, the identification code of the requester and the identification code of the receiver may be used to query in the router list, and the queried router capable of simultaneously connecting the requester and the receiver may be used as the target router.
S13, the first message is sent to the target router by the requester, and the first message is recombined in the target router to obtain a second message.
In this embodiment, after the first packet is sent from the requester to the target router, the first packet is parsed in the target router to obtain a request service code, and the requester and the receiver can be determined by using the request service code.
Further, related information of the target router needs to be added to the first message for the receiver to recognize.
Specifically, the step of recombining the first message in the target router to obtain a second message includes:
acquiring router information of the target router;
and adding the router information to the first message to obtain the second message.
Wherein the router information includes, but is not limited to: router identification code, router name, router resource, router model.
Through the implementation manner, the analysis and recombination of the message are realized in the target router, and the related information of the target router is added to the message, so that the subsequent receiver can identify the target router and feed back data through the target router.
S14, the second message is sent to the receiver by the target router, and the second message is analyzed in the receiver to obtain configuration information.
In at least one embodiment of the present invention, the configuration information includes processing class information, through which a corresponding task parameter can be obtained.
S15, generating an instance based on the configuration information at the receiving side, and calling a service party by using the instance to obtain a request result.
In this embodiment, the service party may include an external service system, or may include an internal service module, which is not limited by the present invention.
When the service party is an external service system, the service party needs to communicate with each other through a gateway by using a transmission protocol such as HTTP (Hyper Text Transfer Protocol ).
In at least one embodiment of the present invention, the generating, at the receiving side, an instance based on the configuration information includes:
Acquiring task parameters from the receiver based on the configuration information;
dynamically loading a service implementation class according to the task parameters;
And assembling the service implementation class to obtain the instance.
Through the embodiment, the task requested by the requester is packaged as an example, so that the example is used for realizing the call to the service party.
S16, feeding back the request result to the target router by the receiver, and recombining the request result into a third message by the target router.
In at least one embodiment of the present invention, the requesting party can be determined by parsing the request result, for example, the requesting party can be determined by a requesting party identification code obtained after parsing.
Further, the request result is recombined to obtain a message form which can be identified by the request party, namely the third message.
S17, returning the third message to the requester by the target router.
In the embodiment, each application end uses the router as the interaction center and mutually uses the router as the interaction center to interact data with the receiver, so that the data do not need to be uniformly stored in one database to cause database burden, remote procedure call is realized by using a distributed network architecture, and the router is used for uniform call, so that a call method is unified, redundancy is avoided, and management and monitoring are convenient.
In at least one embodiment of the invention, the method further comprises:
Acquiring a thread adopted when the call request is sent out as a first thread;
After the first message is sent to the target router by the requester, freezing the first thread and releasing the resources of the first thread;
And restarting the first thread after returning the third message to the requester by the target router.
Wherein the resources of the first thread include, but are not limited to: CPU (central processing unit ), memory.
In the embodiment, the thread is woken up again only when the returned data is received by avoiding the waste caused by the constant occupation of the resources through the freezing of the thread and the release of the resources, so that the asynchronous call is realized, and the robustness and the stability of the system are enhanced.
In at least one embodiment of the invention, the method further comprises:
after the first message is sent to the target router by the requester, monitoring whether the first thread is restarted within a preset time period;
Returning an interface access timeout when the first thread is not restarted within the preset duration; or alternatively
When the first thread is restarted within the preset duration, analyzing the third message to obtain an analysis result, detecting whether the analysis result is abnormal, returning the analysis result to the requesting party when the analysis result is not abnormal, or reporting the abnormality to a designated terminal when the analysis result is abnormal.
The preset duration may be configured in a user-defined manner, for example, 60 seconds.
The designated terminal may include a terminal of a worker responsible for handling the abnormality.
For example: when no result is returned within a prescribed time, or there is a data loss and/or coding error in the returned result. And determining that the abnormality exists, and reporting the abnormality to the appointed terminal.
Through the embodiment, the unified monitoring and processing of the abnormality can be realized, the response speed to the abnormality is effectively improved, and the user experience is optimized.
In at least one embodiment of the invention, the method further comprises:
and configuring the highest initiating request quantity and/or the highest receiving request quantity for the plurality of application ends.
For example: the highest amount of initiated requests and/or the highest amount of received requests may be configured for each application based on the request service code.
Wherein, the highest request amount refers to the highest number of call requests initiated simultaneously.
Wherein, the highest received request quantity refers to the highest quantity of the call requests received simultaneously.
Through the implementation mode, unified current limiting of each application end in the remote procedure call system can be realized, and system breakdown is avoided.
It should be noted that, in order to further improve the security of the data and avoid the data from being tampered maliciously, the third packet may be stored in the blockchain node.
According to the technical scheme, when detecting that an application end sends a call request among the application ends, the method can determine the detected application end as the request end, send the call request to the request end Fang Jiexi to obtain a request object of the request end as the receiving end, generate a first message according to the receiving end and the call request, acquire a pre-configured router list, query the router list by utilizing the request end and the receiving end to obtain a target router, send the first message from the request end to the target router, recombine the first message in the target router to obtain a second message, send the second message from the target router to the receiving end, parse the second message in the receiving end to obtain configuration information, generate an instance based on the configuration information at the receiving end and utilize the instance to call a service party to obtain a request result, feed back the request result from the request end to the target router, and recombine the first message to the target router, and send the second message to the receiving end to the service party. In the invention, each application end uses the router as an interaction center and mutually uses the router as a request party and a receiving party to carry out data interaction, the data is not required to be uniformly stored in one database to cause database burden, remote procedure call is realized by a distributed network architecture, and the router is used for uniformly calling, so that a calling method is unified, redundancy is avoided, and the management and monitoring are convenient.
FIG. 2 is a functional block diagram of a preferred embodiment of a remote procedure call device according to the present invention based on a network architecture. The remote procedure call device 11 based on network architecture includes a determining unit 110, a generating unit 111, a querying unit 112, a reorganizing unit 113, an analyzing unit 114, a call unit 115, and a returning unit 116. The module/unit referred to in the present invention refers to a series of computer program segments capable of being executed by the processor 13 and of performing a fixed function, which are stored in the memory 12. In the present embodiment, the functions of the respective modules/units will be described in detail in the following embodiments.
The remote procedure call device 11 based on the network architecture operates in a remote procedure call system (Remote Procedure Call, RPC) that includes a router and a plurality of application terminals that are a requester and a receiver.
When it is detected that an application terminal issues a call request among the plurality of application terminals, the determination unit 110 determines the detected application terminal as the requester.
In this embodiment, the plurality of application ends perform the interaction between data with the router as the center, which is equivalent to forming a star-like network architecture.
In at least one embodiment of the present invention, when it is detected that any application end requests to join the remote procedure call system, the any application end is registered.
By the implementation mode, any application end is directly registered as long as any application end is detected to request to join the remote procedure call system, so that the time consumption and the resource waste caused by increasing the operation burden of the system in actual call are avoided.
In this embodiment, the application ends belong to internal applications, and can communicate with each other without calling a gateway.
For example: the application end can be each application client end under one enterprise, and the like.
The generating unit 111 obtains the request object of the requester as the receiver in the call request at the request Fang Jiexi, and generates a first message according to the receiver and the call request.
In this embodiment, the manner of resolving the call request is not limited.
Further, after the call request is analyzed, an identification code corresponding to the request object can be obtained, and the receiver is determined according to the identification code corresponding to the request object.
In at least one embodiment of the present invention, the generating unit 111 generates the first message according to the receiving party and the call request includes:
Acquiring request content from the call request and acquiring the appointed format of the message between the receiver and the requester;
starting a pre-implanted processing class component in the receiver according to the call request;
And adopting the processing class component to assemble the request content into the first message based on the appointed format.
The processing class component can be a jar packet, and the processing class component can be embedded in a corresponding terminal in advance for direct calling.
By the embodiment, the corresponding message can be generated at the requesting party according to the requested content and the format requirements of the requesting party and the receiving party, so that the effective transmission of the message can be carried out later.
The query unit 112 obtains a pre-configured router list, and queries the router list by using the requester and the receiver to obtain a target router.
In at least one embodiment of the invention, the router list is used to store all routers connected to a given interface.
Further, the identification code of the requester and the identification code of the receiver may be used to query in the router list, and the queried router capable of simultaneously connecting the requester and the receiver may be used as the target router.
The reassembling unit 113 sends the first message from the requester to the target router, and reassembles the first message in the target router to obtain a second message.
In this embodiment, after the first packet is sent from the requester to the target router, the first packet is parsed in the target router to obtain a request service code, and the requester and the receiver can be determined by using the request service code.
Further, related information of the target router needs to be added to the first message for the receiver to recognize.
Specifically, the recombining unit 113 recombining the first packet in the target router to obtain a second packet includes:
acquiring router information of the target router;
and adding the router information to the first message to obtain the second message.
Wherein the router information includes, but is not limited to: router identification code, router name, router resource, router model.
Through the implementation manner, the analysis and recombination of the message are realized in the target router, and the related information of the target router is added to the message, so that the subsequent receiver can identify the target router and feed back data through the target router.
The parsing unit 114 sends the second message from the target router to the receiving party, and parses the second message in the receiving party to obtain configuration information.
In at least one embodiment of the present invention, the configuration information includes processing class information, through which a corresponding task parameter can be obtained.
The calling unit 115 generates an instance based on the configuration information at the receiving side, and uses the instance to call the service side to obtain the request result.
In this embodiment, the service party may include an external service system, or may include an internal service module, which is not limited by the present invention.
When the service party is an external service system, the service party needs to communicate with each other through a gateway by using a transmission protocol such as HTTP (Hyper Text Transfer Protocol ).
In at least one embodiment of the present invention, the generating, by the calling unit 115, an instance at the receiving party based on the configuration information includes:
Acquiring task parameters from the receiver based on the configuration information;
dynamically loading a service implementation class according to the task parameters;
And assembling the service implementation class to obtain the instance.
Through the embodiment, the task requested by the requester is packaged as an example, so that the example is used for realizing the call to the service party.
The reassembly unit 113 feeds back the request result from the receiving side to the target router, and reassembles the request result into a third message by the target router.
In at least one embodiment of the present invention, the requesting party can be determined by parsing the request result, for example, the requesting party can be determined by a requesting party identification code obtained after parsing.
Further, the request result is recombined to obtain a message form which can be identified by the request party, namely the third message.
The return unit 116 returns the third message from the target router to the requester.
In the embodiment, each application end uses the router as the interaction center and mutually uses the router as the interaction center to interact data with the receiver, so that the data do not need to be uniformly stored in one database to cause database burden, remote procedure call is realized by using a distributed network architecture, and the router is used for uniform call, so that a call method is unified, redundancy is avoided, and management and monitoring are convenient.
In at least one embodiment of the present invention, a thread employed when the call request is issued is acquired as a first thread;
After the first message is sent to the target router by the requester, freezing the first thread and releasing the resources of the first thread;
And restarting the first thread after returning the third message to the requester by the target router.
Wherein the resources of the first thread include, but are not limited to: CPU (central processing unit ), memory.
In the embodiment, the thread is woken up again only when the returned data is received by avoiding the waste caused by the constant occupation of the resources through the freezing of the thread and the release of the resources, so that the asynchronous call is realized, and the robustness and the stability of the system are enhanced.
In at least one embodiment of the present invention, after the first message is sent to the target router by the requester, monitoring whether the first thread is restarted within a preset duration;
Returning an interface access timeout when the first thread is not restarted within the preset duration; or alternatively
When the first thread is restarted within the preset duration, analyzing the third message to obtain an analysis result, detecting whether the analysis result is abnormal, returning the analysis result to the requesting party when the analysis result is not abnormal, or reporting the abnormality to a designated terminal when the analysis result is abnormal.
The preset duration may be configured in a user-defined manner, for example, 60 seconds.
The designated terminal may include a terminal of a worker responsible for handling the abnormality.
For example: when no result is returned within a prescribed time, or there is a data loss and/or coding error in the returned result. And determining that the abnormality exists, and reporting the abnormality to the appointed terminal.
Through the embodiment, the unified monitoring and processing of the abnormality can be realized, the response speed to the abnormality is effectively improved, and the user experience is optimized.
In at least one embodiment of the present invention, the highest amount of initiation requests and/or the highest amount of reception requests are configured for the plurality of application ends.
For example: the highest amount of initiated requests and/or the highest amount of received requests may be configured for each application based on the request service code.
Wherein, the highest request amount refers to the highest number of call requests initiated simultaneously.
Wherein, the highest received request quantity refers to the highest quantity of the call requests received simultaneously.
Through the implementation mode, unified current limiting of each application end in the remote procedure call system can be realized, and system breakdown is avoided.
It should be noted that, in order to further improve the security of the data and avoid the data from being tampered maliciously, the third packet may be stored in the blockchain node.
According to the technical scheme, when detecting that an application end sends a call request among the application ends, the method can determine the detected application end as the request end, send the call request to the request end Fang Jiexi to obtain a request object of the request end as the receiving end, generate a first message according to the receiving end and the call request, acquire a pre-configured router list, query the router list by utilizing the request end and the receiving end to obtain a target router, send the first message from the request end to the target router, recombine the first message in the target router to obtain a second message, send the second message from the target router to the receiving end, parse the second message in the receiving end to obtain configuration information, generate an instance based on the configuration information at the receiving end and utilize the instance to call a service party to obtain a request result, feed back the request result from the request end to the target router, and recombine the first message to the target router, and send the second message to the receiving end to the service party. In the invention, each application end uses the router as an interaction center and mutually uses the router as a request party and a receiving party to carry out data interaction, the data is not required to be uniformly stored in one database to cause database burden, remote procedure call is realized by a distributed network architecture, and the router is used for uniformly calling, so that a calling method is unified, redundancy is avoided, and the management and monitoring are convenient.
FIG. 3 is a schematic diagram of a computer device implementing a remote procedure call method based on a network architecture according to a preferred embodiment of the present invention.
The computer device 1 may comprise a memory 12, a processor 13 and a bus, and may further comprise a computer program stored in the memory 12 and executable on the processor 13, such as a remote procedure call program based on a network architecture.
It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the computer device 1 and does not constitute a limitation of the computer device 1, the computer device 1 may be a bus type structure, a star type structure, the computer device 1 may further comprise more or less other hardware or software than illustrated, or a different arrangement of components, for example, the computer device 1 may further comprise an input-output device, a network access device, etc.
It should be noted that the computer device 1 is only used as an example, and other electronic products that may be present in the present invention or may be present in the future are also included in the scope of the present invention by way of reference.
The memory 12 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 12 may in some embodiments be an internal storage unit of the computer device 1, such as a removable hard disk of the computer device 1. The memory 12 may in other embodiments also be an external storage device of the computer device 1, such as a plug-in mobile hard disk, a smart memory card (SMART MEDIA CARD, SMC), a secure digital (SecureDigital, SD) card, a flash memory card (FLASH CARD) or the like provided on the computer device 1. Further, the memory 12 may also include both an internal storage unit and an external storage device of the computer device 1. The memory 12 may be used not only for storing application software installed in the computer device 1 and various types of data, such as code of a remote procedure call program based on a network architecture, etc., but also for temporarily storing data that has been output or is to be output.
The processor 13 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, various control chips, and the like. The processor 13 is a Control Unit (Control Unit) of the computer device 1, connects the respective components of the entire computer device 1 using various interfaces and lines, executes various functions of the computer device 1 and processes data by running or executing programs or modules stored in the memory 12 (for example, executing a remote procedure call program based on a network architecture, etc.), and calls data stored in the memory 12.
The processor 13 executes the operating system of the computer device 1 and various types of applications installed. The processor 13 executes the application program to implement the steps of the various network architecture based remote procedure call method embodiments described above, such as the steps shown in fig. 1.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules/units may be a series of computer readable instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program in the computer device 1. For example, the computer program may be divided into a determining unit 110, a generating unit 111, a querying unit 112, a reorganizing unit 113, a parsing unit 114, a calling unit 115, a returning unit 116.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional modules are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, a computer device, or a network device, etc.) or a processor (processor) to perform portions of the network architecture-based remote procedure call method according to various embodiments of the present invention.
The modules/units integrated in the computer device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on this understanding, the present invention may also be implemented by a computer program for instructing a relevant hardware device to implement all or part of the procedures of the above-mentioned embodiment method, where the computer program may be stored in a computer readable storage medium and the computer program may be executed by a processor to implement the steps of each of the above-mentioned method embodiments.
Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory, or the like.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The blockchain (Blockchain), essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeit) of its information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The bus may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one straight line is shown in fig. 3, but not only one bus or one type of bus. The bus is arranged to enable a connection communication between the memory 12 and at least one processor 13 or the like.
Although not shown, the computer device 1 may further comprise a power source (such as a battery) for powering the various components, preferably the power source may be logically connected to the at least one processor 13 via a power management means, whereby the functions of charge management, discharge management, and power consumption management are achieved by the power management means. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The computer device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described in detail herein.
Further, the computer device 1 may also comprise a network interface, optionally comprising a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the computer device 1 and other computer devices.
The computer device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the computer device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
Fig. 3 shows only a computer device 1 with components 12-13, it being understood by those skilled in the art that the structure shown in fig. 3 is not limiting of the computer device 1 and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
In connection with fig. 1, the memory 12 in the computer device 1 stores a plurality of instructions to implement a network architecture based remote procedure call method, the processor 13 being executable to implement:
when detecting that an application end sends out a call request in the plurality of application ends, determining the detected application end as the requester;
The call request is sent to the request Fang Jiexi to obtain a request object of the requester as the receiver, and a first message is generated according to the receiver and the call request;
acquiring a pre-configured router list, and inquiring in the router list by utilizing the requesting party and the receiving party to obtain a target router;
The first message is sent to the target router by the requester, and the first message is recombined in the target router to obtain a second message;
The second message is sent to the receiver by the target router, and the second message is analyzed in the receiver to obtain configuration information;
Generating an instance on the receiver based on the configuration information, and calling a service party by using the instance to obtain a request result;
feeding back the request result from the receiver to the target router, and recombining the request result into a third message by the target router;
and returning the third message to the requester by the target router.
Specifically, the specific implementation method of the above instructions by the processor 13 may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
The data in this case were obtained legally.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The invention is operational with numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. The units or means stated in the invention may also be implemented by one unit or means, either by software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (9)

1. The remote procedure call method based on the network architecture is applied to a remote procedure call system, the remote procedure call system comprises a router and a plurality of application ends, and the application ends are a requester and a receiver, and is characterized in that the remote procedure call method based on the network architecture comprises the following steps:
when detecting that an application end sends out a call request in the plurality of application ends, determining the detected application end as the requester;
The call request is sent to the request Fang Jiexi to obtain a request object of the requester as the receiver, and a first message is generated according to the receiver and the call request;
acquiring a pre-configured router list, and inquiring in the router list by utilizing the requesting party and the receiving party to obtain a target router;
The first message is sent to the target router by the requester, and the first message is recombined in the target router to obtain a second message;
The second message is sent to the receiver by the target router, and the second message is analyzed in the receiver to obtain configuration information;
Generating an instance on the receiver based on the configuration information, and calling a service party by using the instance to obtain a request result;
feeding back the request result from the receiver to the target router, and recombining the request result into a third message by the target router;
Returning the third message from the target router to the requester;
The generating a first message according to the receiving party and the call request includes:
Acquiring request content from the call request and acquiring the appointed format of the message between the receiver and the requester;
starting a pre-implanted processing class component in the receiver according to the call request;
adopting the processing class component to assemble the request content into the first message based on the appointed format;
Wherein the processing class component is a jar packet;
The step of recombining the first message in the target router to obtain a second message comprises the following steps:
acquiring router information of the target router;
Adding the router information to the first message to obtain the second message;
Wherein the router information includes: router identification code, router name, router resource, router model.
2. The network architecture based remote procedure call method of claim 1, wherein the method further comprises:
When detecting that any application end requests to join the remote procedure call system, registering the any application end.
3. The network architecture based remote procedure call method of claim 1, wherein the generating an instance at the recipient based on the configuration information comprises:
Acquiring task parameters from the receiver based on the configuration information;
dynamically loading a service implementation class according to the task parameters;
And assembling the service implementation class to obtain the instance.
4. The network architecture based remote procedure call method of claim 1, wherein the method further comprises:
Acquiring a thread adopted when the call request is sent out as a first thread;
After the first message is sent to the target router by the requester, freezing the first thread and releasing the resources of the first thread;
And restarting the first thread after returning the third message to the requester by the target router.
5. The network architecture based remote procedure call method of claim 4, wherein the method further comprises:
after the first message is sent to the target router by the requester, monitoring whether the first thread is restarted within a preset time period;
Returning an interface access timeout when the first thread is not restarted within the preset duration; or alternatively
When the first thread is restarted within the preset duration, analyzing the third message to obtain an analysis result, detecting whether the analysis result is abnormal, returning the analysis result to the requesting party when the analysis result is not abnormal, or reporting the abnormality to a designated terminal when the analysis result is abnormal.
6. The network architecture based remote procedure call method of claim 1, wherein the method further comprises:
and configuring the highest initiating request quantity and/or the highest receiving request quantity for the plurality of application ends.
7. The utility model provides a remote procedure call device based on network architecture, its characterized in that is operated in remote procedure call system, remote procedure call system includes router and a plurality of application ends, a plurality of application ends are the requestor and the receiver each other, remote procedure call device based on network architecture includes:
A determining unit, configured to determine, when it is detected that an application terminal sends a call request from among the plurality of application terminals, the detected application terminal as the requester;
The generating unit is configured to obtain, at the request Fang Jiexi, the call request, and obtain a request object of the requester as the receiver, and generate a first packet according to the receiver and the call request;
The query unit is used for acquiring a pre-configured router list, and querying the router list by utilizing the requester and the receiver to obtain a target router;
The reorganization unit is used for sending the first message from the requesting party to the target router, reorganizing the first message in the target router and obtaining a second message;
the analyzing unit is used for sending the second message from the target router to the receiver and analyzing the second message in the receiver to obtain configuration information;
the calling unit is used for generating an instance on the basis of the configuration information at the receiving party and calling a service party by utilizing the instance to obtain a request result;
the reorganization unit is further configured to feed back the request result from the receiving side to the target router, and reorganize the request result into a third message by the target router;
the return unit is used for returning the third message to the requester by the target router;
The generating a first message according to the receiving party and the call request includes:
Acquiring request content from the call request and acquiring the appointed format of the message between the receiver and the requester;
starting a pre-implanted processing class component in the receiver according to the call request;
adopting the processing class component to assemble the request content into the first message based on the appointed format;
Wherein the processing class component is a jar packet;
The step of recombining the first message in the target router to obtain a second message comprises the following steps:
acquiring router information of the target router;
Adding the router information to the first message to obtain the second message;
Wherein the router information includes: router identification code, router name, router resource, router model.
8. A computer device, the computer device comprising:
a memory storing at least one instruction; and
A processor executing instructions stored in the memory to implement a network architecture based remote procedure call method as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized by: the computer-readable storage medium having stored therein at least one instruction for execution by a processor in a computer device to implement the network architecture-based remote procedure call method of any one of claims 1 to 6.
CN202210037732.2A 2022-01-13 Remote procedure call method, device, equipment and medium based on network architecture Active CN114389988B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210037732.2A CN114389988B (en) 2022-01-13 Remote procedure call method, device, equipment and medium based on network architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210037732.2A CN114389988B (en) 2022-01-13 Remote procedure call method, device, equipment and medium based on network architecture

Publications (2)

Publication Number Publication Date
CN114389988A CN114389988A (en) 2022-04-22
CN114389988B true CN114389988B (en) 2024-07-09

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111049854A (en) * 2019-12-25 2020-04-21 微民保险代理有限公司 Service request transmission method and device
CN113301166A (en) * 2021-06-16 2021-08-24 杭州华橙软件技术有限公司 Service calling method and device, storage medium and electronic device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111049854A (en) * 2019-12-25 2020-04-21 微民保险代理有限公司 Service request transmission method and device
CN113301166A (en) * 2021-06-16 2021-08-24 杭州华橙软件技术有限公司 Service calling method and device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
WO2023056943A1 (en) Internet of things rule engine-based terminal control method and apparatus, and device and medium
CN114124968B (en) Load balancing method, device, equipment and medium based on market data
CN114827161B (en) Service call request sending method and device, electronic equipment and readable storage medium
CN113890712A (en) Data transmission method and device, electronic equipment and readable storage medium
CN114301670B (en) Terminal authentication method, device, equipment and medium based on IPV6 address
CN116405332B (en) Service request method, device, equipment and medium based on Nginx gateway
CN114389988B (en) Remote procedure call method, device, equipment and medium based on network architecture
CN115731047B (en) Batch order processing method, equipment and medium
CN114185502B (en) Log printing method, device, equipment and medium based on production line environment
CN113923218B (en) Distributed deployment method, device, equipment and medium for coding and decoding plug-in
CN114741422A (en) Query request method, device, equipment and medium
CN112540839B (en) Information changing method, device, electronic equipment and storage medium
CN114820132A (en) Order distribution method and device, electronic equipment and storage medium
CN114389988A (en) Remote procedure call method, device, equipment and medium based on network architecture
CN117914943B (en) Data subscription and pushing method, device, equipment and medium
CN116414366B (en) Middleware interface generation method, device, equipment and medium
CN116455997B (en) STEP market multipath forwarding method, STEP market multipath forwarding device, STEP market multipath forwarding equipment and STEP market multipath forwarding medium
CN115174691B (en) Big data loading method, device, equipment and medium based on page request
CN115174665B (en) Login state determining method, device, equipment and storage medium
CN115396376A (en) Load balancing method, device, equipment and storage medium
CN115001945B (en) Log collection monitoring method, device, equipment and computer readable medium
CN113032168B (en) Data transmission rate dynamic adjustment method and device, electronic equipment and storage medium
CN113542387B (en) System release method and device, electronic equipment and storage medium
CN118037453A (en) Order processing method, device, equipment and medium of transaction system
CN114706910A (en) Data interface service method, device, equipment and medium based on FlaskRestful framework

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant