JAVA object requesting and responding methods, devices and systems and terminal

A technology for object and request data, applied in device, JAVA object request and response method, system and terminal fields, can solve the problems that the protobuf message protocol cannot be generalized and componentized, RMI cannot meet high throughput, etc.

Inactive Publication Date: 2012-12-05
融创天下(上海)科技发展有限公司
View PDF4 Cites 29 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0011] The purpose of the embodiments of the present invention is to propose a method for requesting JAVA objects, aiming at solving the technical problems that RMI cannot satisfy high throughput and the protobuf message protocol cannot be generalized and componentized in the prior art

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • JAVA object requesting and responding methods, devices and systems and terminal
  • JAVA object requesting and responding methods, devices and systems and terminal
  • JAVA object requesting and responding methods, devices and systems and terminal

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0082] figure 1 It is the flow chart of the first preferred embodiment of the request method of the JAVA object of the present invention, and the method includes steps:

[0083] S101, creating a request data structure, a response data structure and a request method structure;

[0084] Simultaneously generate corresponding java class by described request data structure, response data structure and request method structure;

[0085] The request data structure includes service name className, service method method and service parameter paramsDescription in string format; the response data structure includes response return code resultCode and response result string object resultDescription; the request method structure includes remote call method and Return the response data structure object;

[0086] For ease of understanding, an example is given to illustrate the process of defining a proto file describing a general business call and generating the corresponding java class as...

Embodiment 2

[0109] figure 2 It is the flow chart of the second preferred embodiment of the request method of the JAVA object of the present invention, and the method includes steps:

[0110] S201, creating a request data structure, a response data structure and a request method structure;

[0111] S202, generating a corresponding java class from the request data structure, response data structure and request method structure;

[0112] S203, loading the JAVA class, service interface, protobuf and protobuf-rpc related jar packages;

[0113] S204, calling a service and a service method corresponding to the service through the service interface;

[0114] S205. Obtain the service method in the request data structure and the service parameters invoked by the service method through the Protobuf JAVA call processor, convert the service parameters into JSON format parameters, and convert the JSON format parameters into strings parameter;

[0115] The Protobuf JAVA call processor is mainly use...

Embodiment 3

[0123] image 3 It is the flow chart of the first preferred embodiment of the response method of the JAVA object of the present invention, and the method includes steps:

[0124] S301, creating a response data structure and a request method structure;

[0125] Further, it is also necessary to create a request data structure, and generate corresponding java classes from the request data structure, response data structure and request method structure;

[0126] The server loads protobuf and protobuf-rpc related jar packages, and establishes a connection with the client through protobuf-rpc;

[0127] In addition, the server publishes the service provided to the client and the service implementation corresponding to the service through the API, JAVA annotations, and Spring configuration files, and stores the service name and service implementation of the service in the service registry;

[0128] Described service realization refers to common java class, and this class only provid...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses JAVA object requesting and responding methods, devices and systems, and a terminal. The requesting method comprises the steps of creating a request data structure, a response data structure and a request method structure, invoking the request method structure to obtain a service method in the request data structure and service parameters invoked by the service method, sequentially converting the service parameters into parameters in a JSON (Javascript Serialized Object Notation) format and character string parameters, constructing a request data structure object, assigning the converted character string parameters into the request data structure object, receiving a response data structure object through the response data structure, obtaining response result character string objects in the response data structure object, and sequentially converting the response result character string objects into response result JSON objects and response result JAVA objects. The purpose of invoking the JAVA objects remotely is realized, port service of the original RMI (Remote Method Invocation) can be replaced, the service logic does not need to be modified, and the port performance is improved.

Description

technical field [0001] The invention relates to the field of calling JAVA objects, in particular to a request and response method, device, system and terminal of a JAVA object. Background technique [0002] In the JAVA language, RMI (Remote Method Invocation) technology already exists as a communication method between JAVA processes, but its processing method cannot meet the needs of high performance (especially the needs of high throughput), while the protobuf message protocol can Transmit over the network in a smaller way. [0003] Protobuf itself has considerable advantages in serialization and deserialization. If it can replace rmi as a remote calling technology for java programs, it can bring geometric performance improvements to applications. [0004] In addition, in actual application scenarios, the calling performance of using the RMI interface can only reach 5000-10000 TPS with 2000 concurrent users, while Protobuf can achieve the performance of 10000-20000 TPS wit...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/46
Inventor 阮航
Owner 融创天下(上海)科技发展有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products