[go: up one dir, main page]

CN115408166A - Remote communication method, device, equipment and storage medium - Google Patents

Remote communication method, device, equipment and storage medium Download PDF

Info

Publication number
CN115408166A
CN115408166A CN202110581858.1A CN202110581858A CN115408166A CN 115408166 A CN115408166 A CN 115408166A CN 202110581858 A CN202110581858 A CN 202110581858A CN 115408166 A CN115408166 A CN 115408166A
Authority
CN
China
Prior art keywords
communication
information
remote
service
function
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.)
Withdrawn
Application number
CN202110581858.1A
Other languages
Chinese (zh)
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.)
Qiku Software Shenzhen Co Ltd
Original Assignee
Qiku Software Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Qiku Software Shenzhen Co Ltd filed Critical Qiku Software Shenzhen Co Ltd
Priority to CN202110581858.1A priority Critical patent/CN115408166A/en
Publication of CN115408166A publication Critical patent/CN115408166A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention belongs to the technical field of communication interaction, and discloses a remote communication method, a remote communication device, remote communication equipment and a storage medium. When receiving remote communication information sent by a client object through a server object, the invention analyzes the remote communication information to obtain communication parameters, communication types and caller identification; when the communication type is a request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function; generating remote response information according to the caller identification and the function response data; and feeding back the remote response information to the client object so that the client object wakes up the corresponding service thread according to the remote response information. The remote communication between the processes can be completed only through the server-side object and the client-side object which are created based on the sockets, the system kernel does not need to be modified, and the method is simple to use and applicable to various devices of non-Android systems.

Description

Remote communication method, device, equipment and storage medium
Technical Field
The present invention relates to the field of communication interaction technologies, and in particular, to a remote communication method, apparatus, device, and storage medium.
Background
Various applications inevitably need to call some more sensitive system functions during running, and the sensitive system functions generally need to have corresponding permissions, for example: when the application needs to call the related functions of the modbus of the serial port, super user permission needs to be provided. However, if the application is a third-party application, that is, an application provided by a third-party developer, which may have a defect or a malicious program, there is a high risk of directly allocating the right to the third-party application, and therefore, when the application needs to access the system function, but does not want to allocate a sensitive right to the application, a remote communication method is needed, so that the application can still call the system function when the application does not have the related right.
In the prior art, a common technology capable of providing remote communication between processes is an Android binder, but if equipment of a non-Android system needs to use the function, a binder driver needs to be compiled into a system kernel of the equipment, the system kernel needs to be greatly modified, and the use is inconvenient.
The above is only for the purpose of assisting understanding of the technical solution of the present invention, and does not represent an admission that the above is the prior art.
Disclosure of Invention
The invention mainly aims to provide a remote communication method, a remote communication device, remote communication equipment and a storage medium, and aims to solve the technical problem that equipment of a non-Android system cannot realize interprocess remote communication without modifying a system kernel.
To achieve the above object, the present invention provides a telecommunication method, comprising the steps of:
when receiving remote communication information sent by a client object through a server object, analyzing the remote communication information to obtain communication parameters, communication types and caller identification;
when the communication type is a request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function;
generating remote response information according to the caller identification and the function response data;
and feeding back the remote response information to the client object so as to enable the client object to awaken a corresponding service thread according to the remote response information.
Optionally, before the step of analyzing the remote communication information sent by the client object to obtain the communication parameter, the communication type, and the caller id, when the remote communication information is received by the server object, the method further includes:
when a service information acquisition request sent by a service access object is received through a service management object, determining a service identifier according to the service information acquisition request;
searching a corresponding object generation standard according to the service identifier;
and feeding back the object generation standard to the service access object so that the service access object constructs a client object according to the object generation standard.
Optionally, the step of analyzing the remote communication information to obtain a communication parameter, a communication type, and a caller id includes:
deserializing the remote communication information through a preset data serialization rule to obtain a communication message header and a communication message body;
and determining a communication type and a caller identification according to the communication message header, and determining a communication parameter according to the communication message body.
Optionally, before the step of deserializing the remote communication information by the preset data serialization rule to obtain the communication message header and the communication message body, the method further includes:
judging whether the remote communication information accords with a preset data serialization rule or not;
and when the remote communication information accords with the preset data serialization rule, executing the step of deserializing the remote communication information through the preset data serialization rule to obtain a communication message header and a communication message body.
Optionally, the step of calling a service processing function corresponding to the remote communication information according to the communication parameter to generate function response data through the service processing function includes:
determining an objective function identifier according to the communication message header;
searching a service processing function corresponding to the remote communication information and a thread pool corresponding to the service processing function according to the target function identification;
when an idle thread exists in the thread pool, acquiring the thread in the thread pool;
and calling the service processing function according to the communication parameters through the thread so as to generate function response data through the service processing function.
Optionally, after the step of searching for the service processing function corresponding to the remote communication information and the thread pool corresponding to the service processing function according to the target function identifier, the method further includes:
when no idle thread exists in the thread pool, generating a function call task according to the communication parameters and the service processing function;
and adding the function call task to a waiting queue corresponding to the thread pool, so that the service processing function is called according to the function call task when an idle thread exists in the thread pool, and function response data is generated through the service processing function.
Optionally, before the step of calling, when the communication type is a request type, a service processing function corresponding to the remote communication information according to the communication parameter to generate function response data through the service processing function, the method further includes:
determining a calling mode according to the remote communication information;
correspondingly, when the communication type is a request type, the step of calling a service processing function corresponding to the remote communication information according to the communication parameter to generate function response data through the service processing function includes:
and when the calling mode is non-unilateral calling and the communication type is a request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function.
Optionally, before the step of calling, according to the communication parameter, a service processing function corresponding to the remote communication information when the communication type is a request type, so as to generate function response data through the service processing function, the method further includes:
searching blacklist information corresponding to the caller identification in a preset communication blacklist;
and when the blacklist information corresponding to the caller identification is not found, executing the step of calling the service processing function corresponding to the remote communication information according to the communication parameters when the communication type is the request type so as to generate function response data through the service processing function.
Optionally, the step of generating remote response information according to the caller id and the function response data includes:
generating a response information header in a standard C data structure according to the caller identification;
generating a response information body according to the function response data;
generating response information according to the response information head and the response information body;
and carrying out data serialization on the response information according to a preset data serialization rule so as to obtain remote response information.
Optionally, before the step of analyzing the remote communication information sent by the client object to obtain the communication parameter, the communication type, and the caller id, when the remote communication information is received by the server object, the method further includes:
when a service notification instruction is detected, determining a service notification message and a server object according to the service notification instruction, and detecting whether a client identifier exists in the service notification instruction;
and when the client identification does not exist in the service notification instruction, pushing the service notification message to each client object corresponding to the server object through the server object, so that the client object feeds back remote communication information to the server object according to the service notification message.
Optionally, after the steps of determining a service notification message and a service object according to the service notification instruction and detecting whether a client identifier exists in the service notification instruction when the service notification instruction is detected, the method further includes:
when a client identifier exists in the service notification instruction, searching a remote session object corresponding to the client identifier in the server object;
and pushing the service notification message to a client object corresponding to the client identifier through the remote session object, so that the client object corresponding to the client identifier feeds back remote communication information to the server object according to the service notification message.
Optionally, after the step of feeding back the remote response information to the client object to enable the client object to wake up the corresponding service thread according to the remote response information, the method further includes:
generating a remote communication log according to the remote communication information, the communication parameters, the communication type, the caller identification and the remote response information;
and storing the remote communication log to a preset storage space.
In addition, to achieve the above object, the present invention further provides a remote communication apparatus, including the following modules:
the information analysis module is used for analyzing the remote communication information sent by the client object when the remote communication information is received by the server object so as to obtain communication parameters, communication types and caller identification;
the data processing module is used for calling a service processing function corresponding to the remote communication information according to the communication parameters when the communication type is the request type so as to generate function response data through the service processing function;
the information generating module is used for generating remote response information according to the caller identification and the function response data;
and the information feedback module is used for feeding the remote response information back to the client object so as to enable the client object to wake up the corresponding service thread according to the remote response information.
Optionally, the information analysis module is further configured to determine a service identifier according to the service information acquisition request when receiving the service information acquisition request sent by the service access object through the service management object; searching a corresponding object generation standard according to the service identifier; and feeding back the object generation standard to the service access object so that the service access object constructs a client object according to the object generation standard.
Optionally, the information analysis module is further configured to perform deserialization on the remote communication information according to a preset data serialization rule to obtain a communication message header and a communication message body; and determining the communication type and the caller identification according to the communication message header, and determining the communication parameters according to the communication message body.
Optionally, the information analysis module is further configured to determine whether the remote communication information conforms to a preset data serialization rule; and when the remote communication information conforms to the preset data serialization rule, executing the step of deserializing the remote communication information through the preset data serialization rule to obtain a communication message header and a communication message body.
Optionally, the data processing module is further configured to determine an objective function identifier according to the communication message header; searching a service processing function corresponding to the remote communication information and a thread pool corresponding to the service processing function according to the target function identification; when an idle thread exists in the thread pool, acquiring the thread in the thread pool; and calling the service processing function according to the communication parameters through the thread so as to generate function response data through the service processing function.
Optionally, the data processing module is further configured to generate a function call task according to the communication parameter and the service processing function when no idle thread exists in the thread pool; and adding the function call task to a waiting queue corresponding to the thread pool, so that the service processing function is called according to the function call task when an idle thread exists in the thread pool, and function response data is generated through the service processing function.
Furthermore, to achieve the above object, the present invention also proposes a remote communication apparatus comprising: a processor, a memory and a telecommunication program stored on said memory and executable on said processor, said telecommunication program realizing the steps of the telecommunication method as described above when executed by the processor.
Furthermore, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a telecommunication program, which when executed implements the steps of the telecommunication method as described above.
When receiving remote communication information sent by a client object through a server object, the invention analyzes the remote communication information to obtain communication parameters, communication types and caller identification; when the communication type is a request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function; generating remote response information according to the caller identification and the function response data; and feeding back the remote response information to the client object so that the client object wakes up the corresponding service thread according to the remote response information. The remote communication between the processes can be completed only through the server-side object and the client-side object which are created based on the sockets, the system kernel does not need to be modified, and the method is simple to use and applicable to various devices of non-Android systems.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a first embodiment of a telecommunications method in accordance with the present invention;
FIG. 3 is a flowchart illustrating a second exemplary embodiment of a telecommunication method according to the present invention;
FIG. 4 is a schematic diagram of class inheritance of an embodiment of a telecommunication method of the present invention;
FIG. 5 is a schematic diagram of an interaction model of an embodiment of a telecommunications method of the present invention;
FIG. 6 is a flowchart illustrating a telecommunication method according to a third embodiment of the invention;
fig. 7 is a block diagram of a first embodiment of a telecommunication device according to the present invention.
The implementation, functional features and advantages of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a remote communication device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the electronic device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement connection communication among these components. The user interface 1003 may include a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a remote communication program.
In the electronic device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 of the electronic device of the present invention may be provided in a telecommunication apparatus, and the electronic device calls a telecommunication program stored in the memory 1005 through the processor 1001 and performs a telecommunication method provided by an embodiment of the present invention.
An embodiment of the present invention provides a remote communication method, and referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a remote communication method according to the present invention.
In this embodiment, the remote communication method includes the following steps:
step S10: when receiving the remote communication information sent by the client object through the server object, analyzing the remote communication information to obtain the communication parameters, the communication type and the caller identification.
It should be noted that the execution main body of this embodiment may be the remote communication device, and the remote communication device may be a device such as a microcomputer, a personal computer, a mobile phone, a tablet computer, and the like, and may also be other devices that can achieve the same or similar functions.
It should be noted that the object (object) may be a memory address, which holds a value and may have an identifier pointing thereto. The server object (RPCServer object) can be an object created by the server process, the client object (RPCClient object) can be an object of the remote access process, both the server object and the client object comprise a remote session object (RPCSession object), the remote session object can comprise a Transact function and an OnTransact function, the Transact function of the remote session object in the client object is called, the OnTransact function of the remote session object in the server object can receive information, and vice versa. The remote access process may be a process in which a third-party application is located, that is, a process that needs to invoke a system function. The server process may be a process with the required permissions to invoke system functions. The remote communication information may include communication parameters, a communication type and a caller identifier, wherein the communication parameters may be parameters required for invoking a system function, the communication type may include a request type and a response type, and the caller identifier may include a process ID of a remote access process and a thread ID of a thread issuing the remote communication information in the remote access process.
It should be noted that both the server object and the client object may be socket-based objects, and no port conflict occurs or there is no number limitation. Wherein, the socket can adopt PF _ UNIX or PF _ LOCAL protocol when being created.
Further, in the remote communication process, in order to facilitate data transmission and ensure that data is not lost, data is generally serialized, and the serialized data cannot be directly read, and in order to quickly obtain a communication parameter, a communication type, and a caller id, the step of analyzing the remote communication information to obtain the communication parameter, the communication type, and the caller id in this embodiment may include: deserializing the remote communication information through a preset data serialization rule to obtain a communication message header and a communication message body; and determining the communication type and the caller identification according to the communication message header, and determining the communication parameters according to the communication message body.
It should be noted that the preset data serialization rule may be preset by a developer, and the preset data serialization rule may include rules such as a data format and a serialization manner of a communication message header (MessageHead), and a data format and a serialization manner of a communication message body (MessageBody).
It can be understood that deserializing the telecommunication information according to the preset data serialization can read the information in the telecommunication information, obtain the communication message header and the communication message body therein, then read the data of the communication message header to obtain the communication type and the caller id, and read the data of the communication message body to obtain the communication parameters.
In practical use, the standard C data structure may be a fixed length array, such as: the array is composed of data of types of int8, int16, int32, int64 and the like, and the formats of the original data and the serialized data of the standard C data structure are the same. Because the data structure of the data in the communication message header is generally simpler, the communication message header can be stored by adopting a standard C data structure, which can reduce the difficulty of data serialization and improve the speed of data serialization, for example: the fixed length is 3, int32 array is used for representing, [ A, B, C ], A is communication type identifier, which can be 0 request type or 1 response type, B is process ID of remote access process, C can be thread ID of thread which sends out remote communication information in remote access process.
The communication message body may store data with a complex data structure, and therefore, the communication message body may be a Protocol Buffers (Protocol Buffers) object. The Protobuf is an open source library of a structure data sequence method developed by Google, and is suitable for complex data structure packaging and serialization, for example: float, string, etc.
Further, although there is an agreement that a data format is used in the data transmission process, it cannot be excluded that a possible phenomenon such as an operation error may occur, which results in a wrong format of the received remote communication message, and if the remote communication message is deserialized directly according to the preset data serialization rule, an error may occur, or even error data may occur, which may cause a great error, and in order to avoid an error caused by the fact that the data format is not deserialized directly, the deserializing the remote communication message by the preset data serialization rule in this embodiment may further include, before the step of obtaining the communication message header and the communication message body:
judging whether the remote communication information accords with a preset data serialization rule or not;
and when the remote communication information accords with the preset data serialization rule, executing the step of deserializing the remote communication information through the preset data serialization rule to obtain a communication message header and a communication message body.
It should be noted that, the determining whether the telecommunication information conforms to the preset data serialization rule may be performing format check on the received telecommunication information, determining whether the special separators such as the data separators and the like therein conform to the convention of the data format in the preset data serialization rule, and whether there is symbol loss such as brackets and the like, and when the format check passes, it may be determined that the telecommunication information conforms to the preset data serialization rule.
It can be understood that if the remote communication information conforms to the preset data serialization rule, the remote communication information can be deserialized through the preset data serialization rule, and if the remote communication information does not conform to the preset data serialization rule, an error code can be returned, and the remote communication method is interrupted without executing the subsequent steps.
Step S20: and when the communication type is the request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function.
It should be noted that, when the communication type is a request type, it may be stated that the remote communication information is actively sent to the server object by the client object in the remote access process, and the remote access process needs to access the corresponding server function. Calling a service processing function corresponding to the remote communication information according to the communication parameters, and generating function response data through the service processing function may be acquiring the service processing function corresponding to the remote communication information, sending the communication parameters to the service processing function, thereby calling the service processing function, and acquiring function response data returned by the service processing function when the service processing function is executed.
Further, in order to avoid the situation that the device is stuck due to an excessive number of simultaneous accesses, step S20 of this embodiment may include:
determining an objective function identifier according to the communication message header; searching a service processing function corresponding to the remote communication information and a thread pool corresponding to the service processing function according to the target function identification; when an idle thread exists in the thread pool, acquiring the thread in the thread pool; and calling the service processing function according to the communication parameters through the thread so as to generate function response data through the service processing function.
It should be noted that, the server object may manage data distribution of only one service processing function, but may also manage data distribution of multiple service processing functions at the same time, and when data distribution of multiple service processing functions is managed at the same time, a corresponding function identifier may be set for each service processing function. The communication message header can be provided with a target function identifier, and the corresponding service processing function can be found according to the target function identifier. If the communication message header is stored in a standard C data structure, the function identifier may be set as a number identifier, for example: the function of function a is identified as 10032.
In actual use, the service processing functions may have corresponding thread pools, one service processing function corresponds to one thread pool, and one thread pool may correspond to a plurality of service processing functions.
It can be understood that, if there is an idle thread in the thread pool, it indicates that the current access number is not large, and the processing may be performed directly, so that a thread may be obtained directly in the thread pool, and then the communication parameter is sent to the service processing function through the thread, the service processing function is called, and function response data returned by the service processing function is obtained when the execution of the service processing function is completed.
Further, in order to avoid excessive simultaneous access and avoid remote access task loss, after the step of searching for the service processing function corresponding to the remote communication information and the thread pool corresponding to the service processing function according to the target function identifier in this embodiment, the method may further include:
when no idle thread exists in the thread pool, generating a function calling task according to the communication parameters and the service processing function; and adding the function call task to a waiting queue corresponding to the thread pool, so that the service processing function is called according to the function call task when an idle thread exists in the thread pool, and function response data is generated through the service processing function.
It should be noted that, if the thread pool does not include an idle thread, it indicates that the current is busy, the number of accesses is large, and then function call is performed, which may cause equipment to be stuck, at this time, the thread call service processing function cannot be continuously obtained from the thread pool, and if no call is performed, message recording is not performed, and if an unexpected situation occurs in the middle, for example: in the case of downtime, power outage, and the like, the remote access task may be lost, and the subsequent execution cannot be continued, so that the function call task may be generated according to the communication parameters and the corresponding service processing function, the function call task is added to the waiting queue corresponding to the thread pool, the thread pool may extract the function call task in the waiting queue when an idle thread exists, call the service processing function recorded in the function call task according to the communication parameters recorded in the function call task, and acquire function response data returned by the service processing function when the execution of the service processing function is completed.
In practical use, the waiting queue may be implemented using a Message queue (Message queue), such as: the common message queues such as ActiveMQ, rabbitMQ, rocktmq, kafka, etc. may also be implemented using a database table, which is not limited in this embodiment.
Further, there may be a single-side call in the actual usage scenario, that is, only sending information to the other side without blocking the call result waiting to be returned, and in order to be compatible with this manner, before step S20 of this embodiment, the method may further include:
determining a calling mode according to the remote communication information;
correspondingly, the step S20 may include:
and when the calling mode is non-unilateral calling and the communication type is a request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function.
It can be understood that, when the invocation mode is the non-unilateral invocation and the communication type is the request type, it may be stated that the remote communication information is actively sent to the server object by the client object for the remote access process, and the remote access process needs to access the corresponding server function and wait for the corresponding return result, so that the subsequent steps may be continuously performed.
In practical use, if the calling mode is single-side calling and the communication type is a request type, it can be stated that the remote communication information is actively sent to the server object by the client object for the remote access process, the remote access process needs to access the corresponding server function, but does not wait for the corresponding return result, at this time, a message can be directly returned to the client object to prompt that the remote communication information is successfully received, and then the service processing function is asynchronously called.
Further, in the actual operation process, it may be found that there is a case that some third-party applications have illegal access, and even possibly in a case of calling a system function maliciously, it is necessary to shield such third-party applications and prohibit them from accessing the service processing function, and in order to achieve the above effect, before step S20 of this embodiment, the method may further include:
searching blacklist information corresponding to the caller identification in a preset communication blacklist;
and when the blacklist information corresponding to the caller identification is not found, executing the step of calling the service processing function corresponding to the remote communication information according to the communication parameters when the communication type is the request type so as to generate function response data through the service processing function.
It should be noted that the preset communication blacklist may store blacklist information, and the blacklist information may include information such as a process ID, an application name, and an application identifier. The searching for the blacklist information corresponding to the caller identification in the preset communication blacklist may be directly searching for the corresponding blacklist information in the preset communication blacklist through a process ID in the caller identification, or may be searching for a corresponding process according to the process ID in the caller identification, acquiring an application running in the process, acquiring an application name and an application identification of the application, and searching for the blacklist information corresponding to the caller identification in the preset communication blacklist according to the application name and/or the application identification. The management personnel can add or delete the blacklist information in the preset communication blacklist according to actual needs.
It can be understood that, if the blacklist information corresponding to the caller id is not found, it indicates that the remote access process initiating the remote communication information is not prohibited from accessing the service processing function, and therefore, the subsequent steps may be executed. If the blacklist information corresponding to the caller identification is found, it indicates that the remote access process initiating the remote communication information is prohibited from accessing the service processing function, and at this time, the subsequent steps may not be executed, and the access prohibition prompting information is directly returned.
Step S30: and generating remote response information according to the caller identification and the function response data.
It will be appreciated that after the business process function is completed, a remote response message needs to be generated and returned to the client object. Therefore, the remote response information can be generated according to the caller identification and the function response data, so that the remote response information can be returned to the client object subsequently.
Further, in order to increase the serialization speed, step S30 of this embodiment may include:
generating a response information header in a standard C data structure according to the caller identification; generating a response information body according to the function response data; generating response information according to the response information head and the response information body; and carrying out data serialization on the response information according to a preset data serialization rule so as to obtain remote response information.
It should be noted that, because the data structure of the data that needs to be included in the response message header is simple, the response message header may be generated by using a standard C data structure, and the data that needs to be included in the response message body is complex, the function response data may be converted into a data structure corresponding to Protobuf, that is, into a Protobuf object, a response message body is generated according to the converted function response data, the generated response message header and the response message body are combined into response information, and finally, the response information is subjected to data serialization according to a preset data serialization rule, so as to obtain the remote response information. And the data structures before and after the standard C data structure serialization are consistent, and the Protobuf object is fast and efficient in serialization, so that the data serialization speed can be greatly improved.
In actual use, the function response data returned by the service processing function can be directly a Protobuf object, and then a response information body is generated directly according to the function response information without data conversion.
Step S40: and feeding back the remote response information to the client object so as to enable the client object to awaken a corresponding service thread according to the remote response information.
It can be understood that after receiving the remote response information, the client object may perform deserialization on the remote response information according to a preset data serialization rule, extract a response information header and a response information body, extract a caller ID from the response information header, extract function response data from the response information body, wake up a corresponding service thread according to a process ID and a thread ID recorded in the caller ID, and then send the function response data to the woken-up service thread for subsequent processing.
Further, in order to facilitate monitoring of the communication process by the administrator and rapid discovery of the malicious request and other phenomena, after step S40 in this embodiment, the method may further include:
generating a remote communication log according to the remote communication information, the communication parameters, the communication type, the caller identification and the remote response information; and storing the remote communication log to a preset storage space.
It can be understood that the remote communication log records remote communication information received in a communication process, communication parameters, communication types and caller identifications obtained after analyzing the remote communication information, and remote response information generated when the execution of the service processing function is completed, and stores the remote communication log into a preset storage space, so that a manager can search the remote communication log corresponding to each remote communication process in the preset storage space, analyze various actions of third-party applications in each remote communication process, quickly determine whether each third-party application has malicious requests and other phenomena, and when the malicious requests exist, add the third-party applications into a preset communication blacklist and prohibit the third-party applications from accessing the service processing function.
When the remote communication information sent by the client object is received by the server object, the remote communication information is analyzed to obtain a communication parameter, a communication type and a caller identification; when the communication type is a request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function; generating remote response information according to the caller identification and the function response data; and feeding back the remote response information to the client object so that the client object wakes up the corresponding service thread according to the remote response information. The remote communication between the processes can be completed only through the server object and the client object which are created based on the sockets, the system kernel does not need to be modified, and the method is simple to use and applicable to various devices of non-Android systems.
Referring to fig. 3, fig. 3 is a flowchart illustrating a telecommunication method according to a second embodiment of the invention.
Based on the first embodiment, before the step S10, the remote communication method of this embodiment further includes:
step S01: when a service information acquisition request sent by a service access object is received through a service management object, a service identifier is determined according to the service information acquisition request.
It should be noted that the service management object may be a public remote invocation object created by a system process, where an object generation standard of each server object may be recorded, that is, each process may obtain an object creation standard corresponding to the service management object, and create a service access object according to the object creation standard of the service management object.
In actual use, a remote calling method and a remote callback method of a parent interface IBaseCore declaration service management object can be created, two child interfaces BaseCore:Stuband BaseCore are created, wherein the BaseCore:Stubis inherited to an RPCClient class, the BaseCore is inherited to an RPCServer class, an implementation class Core of the BaseCore is created, the IBaseCore in the Core implements the defined remote calling method and the remote callback method, the Core implementation class is loaded to a memory to obtain the service management object, the BaseCore:Stubis recorded with an object generation standard corresponding to the service management object, and as a Unix file node in the BaseCore is fixed and disclosed, any process can obtain the Unix file node, so that the BaseCore:Stubis obtained, and a service access object is created according to BaseCore to communicate with the service management object.
As shown in fig. 4, fig. 4 is a class inheritance schematic diagram of the present embodiment, and takes a server object corresponding to a Modbus protocol as an example, to create a method, a parameter, and a return value for a remote call of a parent interface IProtocol statement; creating two subinterface protocols, namely Stub and Protocol, wherein the Stub inherits the RPCClient class and records an object construction standard corresponding to the server object; the method comprises the steps that Protocol inherits an RPCServer class, a Modbus class inheriting the Protocol is created, a remote calling method and a remote callback method defined in IProtocol are realized in the Modbus class, then the Modbus class is loaded to a memory, a server object corresponding to a Modbus Protocol can be obtained, after the server object is created, a service Identifier (ID) can be specified, the server object corresponding to the Modbus Protocol is registered to a service management object according to the service identifier through a pre-created service access object, and the service identifier and Protocol:: stub are sent to the service management object to be stored.
It should be noted that, if a remote access process needs to access a service processing function corresponding to a server object, a client object capable of communicating with the server object needs to be created, and since each server object is not a public object and the corresponding object generation standard cannot be directly obtained, the remote access process needs to first send a service information acquisition request to a service management object through the service access object, obtain an object generation standard corresponding to the server object according to a service identifier included in the service information acquisition request, and then generate the client object according to the object generation standard, thereby implementing object communication with the server.
Step S02: and searching a corresponding object generation standard according to the service identifier.
It can be understood that, when each server object is registered in the service management object, the corresponding service identifier and the object generation standard are sent, so that the object generation standard of the corresponding server object can be found in the service management object according to the service identifier.
Step S03: and feeding back the object generation standard to the service access object so that the service access object constructs a client object according to the object generation standard.
It can be understood that, after receiving the object generation standard, the service access object may create a client object according to the object generation standard, so that the client object may be created by communicating with the server object through the client object, that is, creating a subclass according to the received Protocol:: stub, and then loading the subclass into the memory.
As shown in fig. 5, fig. 5 is a schematic diagram of an interaction model between a client object and a server object according to an embodiment, where the client object is obtained by instantiating a realization class of Stub according to Protocol, the server object is obtained by instantiating a Modbus class, where the Protocol is inherited by an RPCClient class, the RPCClient class may include a member variable RPCSession, modbus is a Protocol subclass, the Protocol is inherited by an RPCServer, and the RPCServer class may include a member variable RPCSession set, so that the client object includes methods declared in the Protocol and rpcsient and an RPCSession object, the server object includes methods declared in the Protocol and RPCServer and multiple RPCSession objects, each rpesection may correspond to one client object, and the server object may communicate with multiple client objects through the RPCSession set.
The embodiment determines a service identifier according to a service information acquisition request when the service management object receives the service information acquisition request sent by a service access object; searching a corresponding object generation standard according to the service identifier; and feeding back the object generation standard to the service access object so that the service access object constructs a client object according to the object generation standard. Because the object creation standard of each server object is managed by creating the service management object, the object creation standard of the server object is managed uniformly, the use complexity can be reduced, the object creation standard of each server object does not need to be directly disclosed, and the use safety is improved.
Referring to fig. 6, fig. 6 is a flowchart illustrating a telecommunication method according to a second embodiment of the invention.
Based on the first embodiment, before the step S10, the remote communication method of this embodiment further includes:
step S01': when a service notification instruction is detected, determining a service notification message and a service end object according to the service notification instruction, and detecting whether a client end identifier exists in the service notification instruction.
The service notification instruction may be an instruction generated by a user operation, or may be an instruction generated after receiving a message sent by another device, for example: if the user needs to send data to other applications, a service notification instruction can be generated; or, when the received message sent by the other device is processed, data is sent to the other application according to the service requirement, a service notification instruction may be generated. The service notification instruction may include a service notification message, a service object identifier, and a client identifier. And determining that the service notification message and the service end object can be the analysis service notification instruction according to the service notification instruction, acquiring the service notification message and the service end object identifier, and searching the corresponding service end object according to the service end object identifier. Detecting whether the client identifier exists in the service notification instruction may be detecting whether a client identifier field is included in the service notification instruction, if not, determining that the client identifier does not exist in the service notification instruction, if so, obtaining a value corresponding to the client identifier field, if the corresponding value is null, determining that the client identifier does not exist in the service notification instruction, and if not, determining that the client identifier exists in the service notification instruction.
Step S02': and when the client identification does not exist in the service notification instruction, pushing the service notification message to each client object corresponding to the server object through the server object, so that the client object feeds back remote communication information to the server object according to the service notification message.
It should be noted that one server object may include a plurality of remote session objects, each remote session object corresponds to one client object, and the server object may communicate with a plurality of client objects simultaneously through the included plurality of remote session objects. If the service notification instruction does not have the client identifier, it indicates that the service notification is not specified to be performed on a certain client object but notifies all the client objects, so that the server object can push the service notification message to each client object corresponding to the server object through a plurality of included remote session objects, and after receiving the service notification message, the client object can feed back the remote communication information to the server object, at this time, the communication type in the fed-back remote communication information may be a response type, and only the server object is notified that the service notification message has been received.
It can be understood that, if the client object needs to access the system function according to actual requirements after receiving the remote communication information, the communication type of the fed-back remote communication information may also be the request type.
Further, in order to perform targeted processing when the client identifier exists in the service notification instruction, after step S01', the method may further include:
when a client identifier exists in the service notification instruction, searching a remote session object corresponding to the client identifier in the server object;
and pushing the service notification message to a client object corresponding to the client identifier through the remote session object, so that the client object corresponding to the client identifier feeds back remote communication information to the server object according to the service notification message.
It should be noted that, if a client identifier exists in the service notification instruction, it indicates that the service notification is directed to a certain client object, and is not sent to all client objects, and each remote session object corresponds to each client object, the corresponding remote session object may be found according to the client identifier, the service notification message is pushed to the client object corresponding to the client identifier through the remote session object, and after receiving the service notification message, the client object may feed back the remote communication information to the server object, at this time, the communication type in the fed-back remote communication information may be a response type, and only the server object is notified that the service notification message has been received.
It can be understood that, if the client object needs to access the system function according to the actual requirement after receiving the remote communication information, the communication type of the remote communication information fed back may also be the request type.
In the embodiment, when a service notification instruction is detected, a service notification message and a server object are determined according to the service notification instruction, and whether a client identifier exists in the service notification instruction is detected; and when the client identification does not exist in the service notification instruction, pushing the service notification message to each client object corresponding to the server object through the server object, so that the client object feeds back remote communication information to the server object according to the service notification message. The server object can comprise a plurality of remote session objects, and each remote session object can correspond to one client object, so that the server object can be communicated with a plurality of client objects simultaneously, and information can be actively sent to the client objects through the remote session objects when needed, and the scene universality is improved.
Furthermore, an embodiment of the present invention further provides a storage medium, on which a remote communication program is stored, and the remote communication program implements the steps of the remote communication method as described above when executed by a processor.
Referring to fig. 7, fig. 7 is a block diagram of a remote communication apparatus according to a first embodiment of the present invention.
As shown in fig. 7, the remote communication apparatus according to the embodiment of the present invention includes:
the information analysis module 501 is configured to, when receiving, by a server object, remote communication information sent by a client object, analyze the remote communication information to obtain a communication parameter, a communication type, and a caller id;
a data processing module 502, configured to, when the communication type is a request type, invoke a service processing function corresponding to the remote communication information according to the communication parameter, so as to generate function response data through the service processing function;
an information generating module 503, configured to generate remote response information according to the caller id and the function response data;
an information feedback module 504, configured to feed back the remote response information to the client object, so that the client object wakes up a corresponding service thread according to the remote response information. .
When the remote communication information sent by the client object is received by the server object, the remote communication information is analyzed to obtain a communication parameter, a communication type and a caller identification; when the communication type is a request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function; generating remote response information according to the caller identification and the function response data; and feeding back the remote response information to the client object so that the client object wakes up the corresponding service thread according to the remote response information. The remote communication between the processes can be completed only through the server object and the client object which are created based on the sockets, the system kernel does not need to be modified, and the method is simple to use and applicable to various devices of non-Android systems.
Further, the information parsing module 501 is further configured to, when receiving a service information obtaining request sent by a service access object through a service management object, determine a service identifier according to the service information obtaining request; searching a corresponding object generation standard according to the service identifier; and feeding back the object generation standard to the service access object so that the service access object constructs a client object according to the object generation standard.
Further, the information parsing module 501 is further configured to perform deserialization on the remote communication information according to a preset data serialization rule to obtain a communication message header and a communication message body; and determining the communication type and the caller identification according to the communication message header, and determining the communication parameters according to the communication message body.
Further, the information analysis module 501 is further configured to determine whether the remote communication information conforms to a preset data serialization rule; and when the remote communication information accords with the preset data serialization rule, executing the step of deserializing the remote communication information through the preset data serialization rule to obtain a communication message header and a communication message body.
Further, the data processing module 502 is further configured to determine an objective function identifier according to the communication message header; searching a service processing function corresponding to the remote communication information and a thread pool corresponding to the service processing function according to the target function identification; when an idle thread exists in the thread pool, acquiring the thread in the thread pool; and calling the service processing function according to the communication parameters through the thread so as to generate function response data through the service processing function.
Further, the data processing module 502 is further configured to generate a function call task according to the communication parameter and the service processing function when an idle thread does not exist in the thread pool; and adding the function calling task to a waiting queue corresponding to the thread pool, so that the service processing function is called according to the function calling task when an idle thread exists in the thread pool, and function response data is generated through the service processing function.
Further, the data processing module 502 is further configured to determine a calling manner according to the remote communication information;
the data processing module 502 is further configured to, when the calling manner is a non-unilateral call and the communication type is a request type, call a service processing function corresponding to the remote communication information according to the communication parameter, so as to generate function response data through the service processing function.
Further, the data processing module 502 is further configured to search a blacklist information corresponding to the caller identifier in a preset communication blacklist; and when the blacklist information corresponding to the caller identification is not found, executing the step of calling a service processing function corresponding to the remote communication information according to the communication parameters when the communication type is the request type so as to generate function response data through the service processing function.
Further, the information generating module 503 is further configured to generate a response header in a standard C data structure according to the caller id; generating a response information body according to the function response data; generating response information according to the response information head and the response information body; and carrying out data serialization on the response information according to a preset data serialization rule so as to obtain remote response information.
Further, the information parsing module 501 is further configured to, when a service notification instruction is detected, determine a service notification message and a server object according to the service notification instruction, and detect whether a client identifier exists in the service notification instruction; and when the client identification does not exist in the service notification instruction, pushing the service notification message to each client object corresponding to the server object through the server object, so that the client object feeds back remote communication information to the server object according to the service notification message.
Further, the information analysis module 501 is further configured to, when a client identifier exists in the service notification instruction, search a remote session object corresponding to the client identifier in the server object; and pushing the service notification message to a client object corresponding to the client identifier through the remote session object, so that the client object corresponding to the client identifier feeds back remote communication information to the server object according to the service notification message.
Further, the information feedback module 504 is further configured to generate a remote communication log according to the remote communication information, the communication parameter, the communication type, the caller id, and the remote response information; and storing the remote communication log to a preset storage space.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited thereto.
It should be noted that the above-mentioned work flows are only illustrative and do not limit the scope of the present invention, and in practical applications, those skilled in the art may select some or all of them according to actual needs to implement the purpose of the solution of the present embodiment, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the remote communication method provided in any embodiment of the present invention, and are not described herein again.
Furthermore, it should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. a Read Only Memory (ROM)/RAM, a magnetic disk, and an optical disk), and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
The invention discloses A1, a remote communication method, which comprises the following steps:
when receiving remote communication information sent by a client object through a server object, analyzing the remote communication information to obtain communication parameters, communication types and caller identification;
when the communication type is a request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function;
generating remote response information according to the caller identification and the function response data;
and feeding back the remote response information to the client object so as to enable the client object to awaken a corresponding service thread according to the remote response information.
A2, the remote communication method according to A1, wherein before the step of analyzing the remote communication information to obtain the communication parameter, the communication type, and the caller id when the remote communication information sent by the client object is received by the server object, the method further includes:
when a service information acquisition request sent by a service access object is received through a service management object, determining a service identifier according to the service information acquisition request;
searching a corresponding object generation standard according to the service identifier;
and feeding back the object generation standard to the service access object so that the service access object constructs a client object according to the object generation standard.
A3, the telecommunication method as set forth in A1, wherein the step of analyzing the telecommunication information to obtain the communication parameters, the communication type and the caller id comprises:
deserializing the remote communication information through a preset data serialization rule to obtain a communication message header and a communication message body;
and determining a communication type and a caller identification according to the communication message header, and determining a communication parameter according to the communication message body.
A4, the remote communication method according to A3, wherein before the step of deserializing the remote communication information by a preset data serialization rule to obtain a communication message header and a communication message body, the method further includes:
judging whether the remote communication information accords with a preset data serialization rule or not;
and when the remote communication information accords with the preset data serialization rule, executing the step of deserializing the remote communication information through the preset data serialization rule to obtain a communication message header and a communication message body.
A5, the remote communication method according to A3, wherein the step of calling the service processing function corresponding to the remote communication information according to the communication parameter to generate the function response data through the service processing function, includes:
determining a target function identifier according to the communication message header;
searching a service processing function corresponding to the remote communication information and a thread pool corresponding to the service processing function according to the target function identification;
when an idle thread exists in the thread pool, acquiring the thread in the thread pool;
and calling the service processing function according to the communication parameters through the thread so as to generate function response data through the service processing function.
A6, after the step of searching for the service processing function corresponding to the remote communication information and the thread pool corresponding to the service processing function according to the target function identifier, the remote communication method according to the aspect A5 further includes:
when no idle thread exists in the thread pool, generating a function calling task according to the communication parameters and the service processing function;
and adding the function calling task to a waiting queue corresponding to the thread pool, so that the service processing function is called according to the function calling task when an idle thread exists in the thread pool, and function response data is generated through the service processing function.
A7, the remote communication method according to any one of A1 to A6, further including, before the step of calling, according to the communication parameter, a service processing function corresponding to the remote communication information when the communication type is a request type, and generating function response data by the service processing function:
determining a calling mode according to the remote communication information;
when the communication type is a request type, the step of calling a service processing function corresponding to the remote communication information according to the communication parameters to generate function response data through the service processing function comprises the following steps:
and when the calling mode is non-unilateral calling and the communication type is a request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function.
A8, the remote communication method according to any one of A1 to A6, further including, before the step of calling, according to the communication parameter, a service processing function corresponding to the remote communication information when the communication type is a request type, and generating function response data by the service processing function:
searching blacklist information corresponding to the caller identification in a preset communication blacklist;
and when the blacklist information corresponding to the caller identification is not found, executing the step of calling the service processing function corresponding to the remote communication information according to the communication parameters when the communication type is the request type so as to generate function response data through the service processing function.
The telecommunication method according to any one of claims A1 to A6, wherein the step of generating the remote response information based on the caller id and the function response data includes:
generating a response information header in a standard C data structure according to the caller identification;
generating a response information body according to the function response data;
generating response information according to the response information head and the response information body;
and carrying out data serialization on the response information according to a preset data serialization rule so as to obtain remote response information.
A10, the telecommunication method according to any one of A1 to A6, further comprising, before the step of analyzing the telecommunication information to obtain the communication parameters, the communication type and the caller id when the telecommunication information sent by the client object is received by the server object:
when a service notification instruction is detected, determining a service notification message and a service end object according to the service notification instruction, and detecting whether a client end identifier exists in the service notification instruction;
and when the client identification does not exist in the service notification instruction, pushing the service notification message to each client object corresponding to the server object through the server object, so that the client object feeds back remote communication information to the server object according to the service notification message.
A11, the telecommunication method as recited in a10, after the step of determining a service notification message and a server object according to the service notification instruction when the service notification instruction is detected, and detecting whether a client identifier exists in the service notification instruction, the method further includes:
when a client identifier exists in the service notification instruction, searching a remote session object corresponding to the client identifier in the server object;
and pushing the service notification message to a client object corresponding to the client identifier through the remote session object, so that the client object corresponding to the client identifier feeds back remote communication information to the server object according to the service notification message.
A12, the remote communication method according to any one of A1 to A6, wherein after the step of feeding back the remote response information to the client object so that the client object wakes up the corresponding service thread according to the remote response information, the method further includes:
generating a remote communication log according to the remote communication information, the communication parameters, the communication type, the caller identification and the remote response information;
and storing the remote communication log to a preset storage space.
The invention discloses a B13 remote communication device, which comprises the following modules:
the information analysis module is used for analyzing the remote communication information sent by the client object when the remote communication information is received by the server object so as to obtain a communication parameter, a communication type and a caller identification;
the data processing module is used for calling a service processing function corresponding to the remote communication information according to the communication parameters when the communication type is the request type so as to generate function response data through the service processing function;
the information generating module is used for generating remote response information according to the caller identification and the function response data;
and the information feedback module is used for feeding the remote response information back to the client object so as to enable the client object to wake up the corresponding service thread according to the remote response information.
B14, the remote communication apparatus according to B13, wherein the information parsing module is further configured to determine a service identifier according to a service information obtaining request sent by a service access object when the service information obtaining request is received by a service management object; searching a corresponding object generation standard according to the service identifier; and feeding back the object generation standard to the service access object so that the service access object constructs a client object according to the object generation standard.
B15, the remote communication apparatus according to B13, wherein the information parsing module is further configured to perform deserialization on the remote communication information according to a preset data serialization rule to obtain a communication message header and a communication message body; and determining the communication type and the caller identification according to the communication message header, and determining the communication parameters according to the communication message body.
B16, the remote communication apparatus according to B15, wherein the information parsing module is further configured to determine whether the remote communication information complies with a preset data serialization rule; and when the remote communication information accords with the preset data serialization rule, executing the step of deserializing the remote communication information through the preset data serialization rule to obtain a communication message header and a communication message body.
B17, the remote communication apparatus according to B15, wherein the data processing module is further configured to determine an objective function identifier according to the communication message header; searching a service processing function corresponding to the remote communication information and a thread pool corresponding to the service processing function according to the target function identification; when an idle thread exists in the thread pool, acquiring the thread in the thread pool; and calling the service processing function according to the communication parameters through the thread so as to generate function response data through the service processing function.
B18, the remote communication apparatus according to B17, wherein the data processing module is further configured to generate a function call task according to the communication parameter and the service processing function when there is no idle thread in the thread pool; and adding the function call task to a waiting queue corresponding to the thread pool, so that the service processing function is called according to the function call task when an idle thread exists in the thread pool, and function response data is generated through the service processing function.
The invention discloses C19, a remote communication device, comprising: a processor, a memory and a telecommunication program stored on said memory and executable on said processor, said telecommunication program realizing the steps of the telecommunication method as described above when executed by the processor.
The invention discloses a D20, a computer readable storage medium having stored thereon a telecommunication program which when executed implements the steps of a telecommunication method as described above.

Claims (10)

1. A telecommunications method, characterized in that said telecommunications method comprises the steps of:
when receiving remote communication information sent by a client object through a server object, analyzing the remote communication information to obtain communication parameters, communication types and caller identification;
when the communication type is a request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function;
generating remote response information according to the caller identification and the function response data;
and feeding back the remote response information to the client object so as to enable the client object to awaken a corresponding service thread according to the remote response information.
2. A telecommunications method in accordance with claim 1, wherein said step of parsing the telecommunications information sent by the client object to obtain the communication parameters, communication type and caller identification upon receipt of the telecommunications information by the server object further comprises:
when a service information acquisition request sent by a service access object is received through a service management object, determining a service identifier according to the service information acquisition request;
searching a corresponding object generation standard according to the service identifier;
and feeding back the object generation standard to the service access object so that the service access object constructs a client object according to the object generation standard.
3. A telecommunications method in accordance with claim 1, wherein said step of parsing said telecommunications message to obtain communication parameters, communication type, and caller identification comprises:
deserializing the remote communication information through a preset data serialization rule to obtain a communication message header and a communication message body;
and determining a communication type and a caller identification according to the communication message header, and determining a communication parameter according to the communication message body.
4. A telecommunications method in accordance with claim 3, wherein said step of deserializing said telecommunications message by a predetermined data serialization rule to obtain a communication header and a communication body further comprises:
judging whether the remote communication information accords with a preset data serialization rule or not;
and when the remote communication information conforms to the preset data serialization rule, executing the step of deserializing the remote communication information through the preset data serialization rule to obtain a communication message header and a communication message body.
5. The telecommunications method of claim 3, wherein said step of invoking a service handling function corresponding to said telecommunications message according to said communication parameters to generate function response data via said service handling function comprises:
determining an objective function identifier according to the communication message header;
searching a service processing function corresponding to the remote communication information and a thread pool corresponding to the service processing function according to the target function identification;
when an idle thread exists in the thread pool, acquiring the thread in the thread pool;
and calling the service processing function according to the communication parameters through the thread so as to generate function response data through the service processing function.
6. The telecommunications method of claim 5, wherein after the step of searching for the service handling function corresponding to the telecommunications information and the thread pool corresponding to the service handling function according to the objective function identifier, the method further comprises:
when no idle thread exists in the thread pool, generating a function call task according to the communication parameters and the service processing function;
and adding the function call task to a waiting queue corresponding to the thread pool, so that the service processing function is called according to the function call task when an idle thread exists in the thread pool, and function response data is generated through the service processing function.
7. The method according to any one of claims 1 to 6, wherein before the step of calling the service processing function corresponding to the remote communication information according to the communication parameter to generate the function response data through the service processing function when the communication type is the request type, the method further comprises:
determining a calling mode according to the remote communication information;
when the communication type is a request type, the step of calling a service processing function corresponding to the remote communication information according to the communication parameters to generate function response data through the service processing function comprises the following steps:
and when the calling mode is non-unilateral calling and the communication type is a request type, calling a service processing function corresponding to the remote communication information according to the communication parameters so as to generate function response data through the service processing function.
8. A telecommunications apparatus, comprising:
the information analysis module is used for analyzing the remote communication information sent by the client object when the remote communication information is received by the server object so as to obtain a communication parameter, a communication type and a caller identification;
the data processing module is used for calling a service processing function corresponding to the remote communication information according to the communication parameters when the communication type is the request type so as to generate function response data through the service processing function;
the information generating module is used for generating remote response information according to the caller identification and the function response data;
and the information feedback module is used for feeding the remote response information back to the client object so as to enable the client object to wake up the corresponding service thread according to the remote response information.
9. A telecommunications device, wherein the telecommunications device comprises: processor, memory and a telecommunication program stored on the memory and executable on the processor, which telecommunication program when executed by the processor realizes the steps of the telecommunication method as claimed in any one of claims 1-7.
10. A computer-readable storage medium, having stored thereon a telecommunication program, which when executed, carries out the steps of the telecommunication method according to any one of claims 1-7.
CN202110581858.1A 2021-05-26 2021-05-26 Remote communication method, device, equipment and storage medium Withdrawn CN115408166A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110581858.1A CN115408166A (en) 2021-05-26 2021-05-26 Remote communication method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110581858.1A CN115408166A (en) 2021-05-26 2021-05-26 Remote communication method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115408166A true CN115408166A (en) 2022-11-29

Family

ID=84156320

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110581858.1A Withdrawn CN115408166A (en) 2021-05-26 2021-05-26 Remote communication method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115408166A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119862216A (en) * 2024-12-13 2025-04-22 广州市众禾信息科技有限公司 Data query and retrieval method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119862216A (en) * 2024-12-13 2025-04-22 广州市众禾信息科技有限公司 Data query and retrieval method and device

Similar Documents

Publication Publication Date Title
EP4310667A1 (en) Ai application deployment method, and related platform, cluster, medium and program product
US7614059B2 (en) System and method for the discovery and usage of local resources by a mobile agent object
US10223321B2 (en) Combining redirected USB interfaces into a single composite device
CN101853152B (en) Method and system for generating graphical user interface
US20140282630A1 (en) Backend custom code extensibility
CN111309407B (en) Processing method and device for integrating third-party library
CN110457132B (en) Method and device for creating functional object and terminal equipment
US9154380B2 (en) Rules based fetching of operating platform status
CN115408166A (en) Remote communication method, device, equipment and storage medium
US11068613B2 (en) Differentiating and managing identical USB devices
CN113535439B (en) Service request processing method, device, device and storage medium
CN108023966B (en) Method, device and storage medium for processing universal gateway interface request
US20060236308A1 (en) Configurable functionality chaining
CN110119269B (en) Method, device, server and storage medium for controlling task object
CN110245027B (en) Inter-process communication method and device
CN113626001B (en) API dynamic arrangement method and device based on script
CN116737399A (en) Distributed lock implementation method, device, computer equipment and storage medium
CN114443181B (en) A business processing method, application generation method, server, device and equipment
CN114610343B (en) Application function realization method and device, computer equipment and storage medium
CN117369946A (en) Container deployment method and device based on DPU, electronic equipment and medium
CN116432218A (en) Methods for Resource Object Protection
CN119496815B (en) Method and apparatus for dynamically loading service channels and instances based on the AutosAP platform
CN115328488A (en) Code compiling method, device, equipment and storage medium based on compiling cluster
CN106570143B (en) Method and device for sending response object
CN113032010B (en) Command transmission control method, terminal and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20221129