A data object-oriented remote procedure call method and related equipment

The memory mirroring consistency between the client and the server is achieved through the memory mapping mechanism, which solves the efficiency and consistency problems of data object transmission in remote procedure calls and improves the reliability of application systems on the cloud computing platform.

CN117667451BActive Publication Date: 2025-09-12TRAVELSKY TECHNOLOGY LIMITED
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311623183.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2025-09-12
Estimated Expiration
2043-11-30

AI Technical Summary

Technical Problem

The existing remote procedure call method cannot correctly handle pointers during data object transmission, resulting in inconsistencies between the runtime data structure and the serialized data structure, reducing space and time efficiency and increasing the difficulty of adaptive transformation development work.

Method used

A remote procedure call method based on a memory mapping mechanism is adopted. Through memory address partition management and memory mapping mechanism, memory mirror consistency between the client and the server is achieved, address conflicts are avoided, and direct calls of arbitrarily complex runtime data objects are supported.

Benefits of technology

It improves the efficiency and reliability of remote procedure calls of data objects, reduces the workload of transformation, and ensures the reliability of application systems on cloud computing platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117667451B_ABST
    Figure CN117667451B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data object-oriented remote procedure call method and related equipment, which are applied to the client and can use the memory mapping mechanism to realize the deserialization of remote procedure calls, so that the data objects are completely consistent in the memory mirror in the client process and the server process. Through memory address partition management, the address space used by the client and the server for the data objects is completely consistent, avoiding address conflicts, thereby improving the efficiency of remote procedure calls of data objects and ensuring the reliability of the application system after migration to the cloud computing platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of cloud migration technology, and in particular to a data object-oriented remote procedure call method and related equipment. Background Art

[0002] With the rapid development of cloud computing technology, cloud computing services, which have the advantages of large scale, virtualization, high reliability, strong versatility, high scalability and low cost, have saved data costs and resources for enterprises, making enterprises more actively migrate their application systems to cloud computing platforms.

[0003] However, during the migration of the application system, the application system needs to be adapted to the cloud environment to fully utilize the capabilities of the cloud computing platform. Adaptive transformation can be achieved by decoupling business and data through layered design, or by creating applications around business domain components through a microservice architecture. These applications can be developed, managed, and accelerated independently. Using microservice cloud architecture and platforms in decentralized components makes deployment, management, and service function delivery simpler. The above-mentioned adaptive transformation methods all involve dividing the originally integrated application system into multiple service modules, which means that the original local function mode (call stack) that uses runtime data objects to pass request parameters and results will be changed to a remote process call (RPC) mode.

[0004] In RPC mode applications, existing serialization methods often fail to correctly and perfectly handle pointers, resulting in inconsistencies between runtime data structures and serialized data structures. This reduces the space and time efficiency of data objects during remote procedure calls, increases the difficulty of adaptive development work, and makes the modified application system difficult to maintain.

[0005] Therefore, how to provide a reliable and efficient remote procedure call method for data objects has become a technical problem that those skilled in the art urgently need to solve. Summary of the Invention

[0006] In view of the above problems, the present disclosure provides a data object-oriented remote procedure call method and related devices that overcome the above problems or at least partially solve the above problems. The technical solution is as follows:

[0007] A data object-oriented remote procedure call method, applied to a client, comprising:

[0008] Obtaining the service request sent by the requester;

[0009] generating, according to the business logic of the business request, a plurality of data service requests corresponding to the business request;

[0010] Allocate the memory space corresponding to the reserved address according to the number of threads started, and allocate a corresponding memory partition for each thread in the memory space, wherein the reserved address is a mapping address corresponding to the virtual memory area pre-agreed by the client and the server based on a memory mapping mechanism;

[0011] When any of the threads obtains the data service request, the server sends the next available space first address of the memory partition corresponding to the thread and the data service request to the server, so that the server reads the data at the first address of the available space, processes the data in response to the data service request, and returns a data object obtained after the data processing;

[0012] Creating an anonymous memory area on the memory partition using the first address of the next available space;

[0013] When the data object is obtained, the data object is stored in the anonymous memory area;

[0014] In a case where the data objects corresponding to each data service request are stored in the memory space, each data object in the memory space is processed to obtain a data object processing result, and the data object processing result is sent to the requesting party.

[0015] A data object-oriented remote procedure call device, applied to a client, comprises: a service request obtaining unit, a data service request generating unit, a memory space allocating unit, a request parameter sending unit, a memory area creating unit, a data object storing unit and a data object processing result obtaining unit.

[0016] The service request obtaining unit is used to obtain the service request sent by the requester;

[0017] The data service request generating unit is configured to generate a plurality of data service requests corresponding to the service request according to the service logic of the service request;

[0018] The memory space allocation unit is configured to allocate the memory space corresponding to the reserved address according to the number of threads started, and allocate a corresponding memory partition to each thread in the memory space, wherein the reserved address is a mapping address corresponding to a virtual memory area pre-agreed by the client and the server based on a memory mapping mechanism;

[0019] The request parameter sending unit is configured to, when any of the threads obtains the data service request, send the next available space first address of the memory partition corresponding to the thread and the data service request to the server, so that the server reads the data at the first address of the available space, performs data processing in response to the data service request, and returns a data object obtained after the data processing;

[0020] The memory area creation unit is used to create an anonymous memory area on the memory partition using the first address of the next available space;

[0021] The data object storage unit is configured to store the data object in the anonymous memory area when the data object is obtained;

[0022] The data object processing result obtaining unit is used to process each data object in the memory space, obtain a data object processing result, and send the data object processing result to the requesting party when the data objects corresponding to each data service request are stored in the memory space.

[0023] A computer-readable storage medium stores a program, which implements the data object-oriented remote procedure call method when executed by a processor.

[0024] An electronic device comprising at least one processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory communicate with each other via the bus; and the processor is configured to call program instructions in the memory to execute the data object-oriented remote procedure call method.

[0025] By means of the above technical solution, the present disclosure provides a data object-oriented remote procedure call method and related device, which are applied to a client and can obtain a service request sent by a requester; generate multiple data service requests corresponding to the service request based on the business logic of the service request; allocate memory space corresponding to a reserved address according to the number of threads to be started, and allocate a corresponding memory partition for each thread in the memory space, wherein the reserved address is a mapping address corresponding to a virtual memory area pre-agreed between the client and the server based on a memory mapping mechanism; when any thread obtains a data service request, the next available space first address of the memory partition corresponding to the thread and the data service request are sent to the server, so that the server reads the data at the first address of the available space, processes the data in response to the data service request, and returns the data object obtained after the data processing; creates an anonymous memory area on the memory partition using the next available space first address; when a data object is obtained, stores the data object in the anonymous memory area; when the data objects corresponding to each data service request are stored in the memory space, processes each data object in the memory space to obtain a data object processing result, and sends the data object processing result to the requester. The present disclosure utilizes a memory mapping mechanism to implement deserialization of remote procedure calls, so that data objects are completely consistent memory images in both client and server processes. Memory address partition management is also used to ensure that the address spaces used by the client and server for data objects are completely consistent, thus avoiding address conflicts. This improves the efficiency of remote procedure calls of data objects and ensures the reliability of application systems after migration to cloud computing platforms.

[0026] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the specific implementation methods of the present disclosure are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

[0028] Figure 1 A schematic diagram of an existing serialized remote procedure call architecture is shown;

[0029] Figure 2 A schematic diagram of a remote procedure call architecture based on a memory mapping mechanism provided by an embodiment of the present disclosure is shown;

[0030] Figure 3A flow chart showing an implementation of a data object-oriented remote procedure call method provided by an embodiment of the present disclosure is shown;

[0031] Figure 4 A flow chart illustrating another implementation of a data object-oriented remote procedure call method provided by an embodiment of the present disclosure is shown;

[0032] Figure 5 A flow chart illustrating another implementation of a data object-oriented remote procedure call method provided by an embodiment of the present disclosure is shown;

[0033] Figure 6 A schematic structural diagram of a data object-oriented remote procedure call device provided by an embodiment of the present disclosure is shown;

[0034] Figure 7 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0035] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0036] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0037] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0038] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0039] The architecture of remote procedure call (RPC) consists of four core components: client caller, server function, client stub and server stub. Figure 1 The client stub stores the server's address message, serializes the data object containing the request parameters into a network message, sends it remotely to the server over the network, waits for the server's response, and deserializes the returned network data packet into a local data object. The server stub receives the message sent by the client, deserializes it into a local data object, calls the local method, obtains the data object result, serializes it into a network data packet, and sends it back to the client.

[0040] As a compiled language offering higher performance, high real-time performance, and low latency, C++ is widely used in high-performance backend service systems. Currently, C++ supports serialization methods such as XML, JSON, Google Protobuf, and Boost Serialization. XML and JSON are text protocols with high readability, widely used for data exchange in web development, but they suffer from low space and time efficiency. Google Protobuf and Boost Serialization are binary protocols, providing lightweight and efficient structured data storage formats. They utilize less memory for transmitting the same data, but the former lacks support for the C++ Standard Template Library (STL), while the latter has incomplete pointer handling.

[0041] These common serialization methods often cause inconsistencies between runtime data structures and serialized data structures in RPC applications. This is because general serialization methods have defects and cannot handle pointers. Therefore, a series of conversions are required during the transmission between systems, such as Figure 1 When the data type is complex, a set of serialized data structures with limited types must be redesigned, and the conversion to runtime data structures is also necessary, resulting in bloated code and difficulty in maintenance.

[0042] To address the above issues, the embodiments of the present disclosure provide a data object-oriented remote procedure call method. For complex data objects, a memory mapping remote process call (MMRPC) mechanism is provided, allowing developers to call remote function methods just like calling local methods, and can process arbitrarily complex runtime data objects.

[0043] The remote procedure call architecture based on the memory mapping mechanism provided by the embodiment of the present disclosure can be referred to Figure 2 The disclosed embodiment can utilize Linux's mature memory mapping mechanism (mmap) to solve the pointer serialization problem, and utilize memory address partition management to solve the address conflict problem brought by memory mapping, thereby eliminating the need for type conversion and serialization / deserialization conversion of runtime data objects. Combined with the STL memory allocator mechanism to reuse STL containers, it can support arbitrarily complex runtime data objects.

[0044] like Figure 3 As shown, a flowchart of an implementation of a data object-oriented remote procedure call method provided by an embodiment of the present disclosure is shown. The remote procedure call method is applied to a client and may include:

[0045] S100: Obtain a service request sent by a requester.

[0046] S200: Generate multiple data service requests corresponding to the business request according to the business logic of the business request.

[0047] The disclosed embodiment can obtain a business request sent by an external requester, generate multiple data service requests according to the business logic of the business request, and then start a number of threads that matches the thread resource situation according to the current thread resource situation of the system.

[0048] S300. Allocate the memory space corresponding to the reserved address according to the number of threads started, and allocate a corresponding memory partition for each thread in the memory space, wherein the reserved address is a mapping address corresponding to the virtual memory area pre-agreed by the client and the server based on the memory mapping mechanism.

[0049] The disclosed embodiment can initialize the memory space corresponding to the reserved address, divide the memory space according to the number of threads started, obtain memory partitions with the same number of partitions as the number of threads, and allocate the memory partitions to the corresponding threads.

[0050] It is understandable that in a specific cloud transformation project, the originally integrated business module and data module have the same software and hardware environment after split deployment, such as 64-bit CPU, the same operating system, compiler, STL version, etc., thus having the conditions for directly reusing memory images.

[0051] Specifically, the embodiment of the present disclosure replaces the type conversion and serialization operations on runtime data in the existing serialized remote procedure call with the memory mapping mechanism of Linux, so that the runtime data objects are completely consistent in the memory mirror in both the client process and the server process.

[0052] The fundamental reason why pointers cannot be serialized in existing serialized remote procedure calls is that the address space of the data object in the serialization process and the deserialization process is different. For this purpose, the disclosed embodiment introduces the memory mapping mechanism of Linux. The function prototype of the memory mapping mechanism is: "void*mmap(void*addr,size_t len,intprot,int flags,int fd,off_t offset)", where the parameter "addr" points to the starting address of the memory to be mapped, and is usually set to "NULL", which means that the system automatically selects the address. The memory mapping mechanism specifies a pre-configured reserved address, which is returned after the mapping is successful. The parameter "flags" is set to "MAP_FIXED|MAP_ANONYMOUS". It means that if the address pointed to by the parameter "addr" cannot be successfully mapped, the mapping is abandoned and the address is not corrected. "MAP_ANONYMOUS" creates an anonymous mapping. The parameter "fd" is ignored, no file is involved, and the mapping area cannot be shared with other processes. It is equivalent to using the specified address space simultaneously during the serialization and deserialization process of the server process and the client process, so that the address pointer in the data object naturally remains valid.

[0053] The disclosed embodiment supports native pointers through a memory mapping mechanism without the need for additional definition files, thereby achieving deserialization of remote procedure calls.

[0054] Under normal circumstances, there is a large amount of free space in the 64-bit address space available for application use. The client process and the server process can agree on an unused virtual memory area as the mapped memory space. In this way, the address space used by the client and server for runtime data objects is completely consistent. Furthermore, the embodiment of the present disclosure can plan a 1TB address space of 0x100000000000~0x110000000000 and map it to the process using the memory mapping mechanism.

[0055] S400. When any thread obtains a data service request, the next available space first address of the memory partition corresponding to the thread and the data service request are sent to the server, so that the server reads the data on the available space first address, responds to the data service request, performs data processing, and returns the data object obtained after data processing.

[0056] Specifically, when any unprocessed data service request is detected, the embodiment of the present disclosure can allocate the data service request to an idle thread and send the next available space first address as one of the request parameters together with the data service request to the server.

[0057] S500: Create an anonymous memory area on the memory partition using the first address of the next available space.

[0058] The client generally calls the remote server multiple times serially or concurrently. In order to avoid address conflicts when returning multiple data objects, unified memory address management is required to force the next available space starting address (current pointer) in the client request to be used as the starting address of the anonymous memory area in the memory mapping mechanism.

[0059] Optional, based on Figure 3 The method shown, such as Figure 4 As shown, a flowchart of another implementation of the data object-oriented remote procedure call method provided by an embodiment of the present disclosure is shown, and step S500 may include:

[0060] S510: Use a memory allocation algorithm in a preset memory allocator to perform memory address partition management on the memory partition, and create an anonymous memory area corresponding to the first address of the next available space on the memory partition.

[0061] Runtime data objects have the characteristics of free and complex structures. They may be basic C++ data types, such as "int", "double" and "string" and other primitive data types, or they may be containers in STL and user-defined nested arbitrarily complex data types. Assume that a complex data object is a "key-value" key-value pair structure, where the "value" part is an array of key-value pair structures. It is time-consuming and labor-intensive to implement a hash table data structure with operations such as search and addition, deletion, and modification. Moreover, the "value" part may also nest complex objects, which not only requires a large amount of code work but also has low development efficiency. Therefore, the embodiments of the present disclosure support data objects with complex structures by using associative containers of map or unordered_map related types in STL.

[0062] The preset memory allocator may be an STL memory allocator, and the memory allocation algorithm may be a conventional memory allocation algorithm.

[0063] The disclosed embodiments can build a custom memory allocator based on the C++ mechanism for allocating memory of arbitrarily complex data types to a specified memory area. The memory allocator can allocate memory to a specified area for data objects of native and user-defined data types using the placement new mechanism. The disclosed embodiments can allocate memory for various container types in the STL to a specified area using a custom allocator.

[0064] The disclosed embodiment uses a custom memory allocator to allocate various runtime C++ objects of varying sizes that need to be remotely transmitted from a specified address space. Ultimately, the remote process dumps the memory image with consecutive addresses within the specified memory area as a result data packet.

[0065] For data objects with complex structures, if protobuf or boost serialization is used, the cloudification transformation project requires the addition of a set of data structure types that meet serialization requirements. Business modules and data modules must either be restructured to adapt to this data structure or convert the serialized structure back to the original runtime data structure. This transformation is not only extensive but also time-consuming. The disclosed embodiment supports memory allocation for standard containers and arbitrary nested structures through a pre-set memory allocator. This not only minimizes the scope of modification but also reduces the risk of transformation because it does not involve changes to the business structure.

[0066] Optionally, when receiving multiple data service requests, the server responds to each data service request in sequence, and after completing data processing for one data service request, it processes data for another data service request.

[0067] Since the address spaces planned by the client and the server are the same and the server only processes one serialized data object at a time, address conflicts can be avoided, so that the server reads data according to the first address of the next available space after receiving the corresponding data service request.

[0068] S600: When a data object is obtained, the data object is stored in an anonymous memory area.

[0069] Optional, based on Figure 3 The method shown, such as Figure 5 As shown, a flowchart of another implementation of the data object-oriented remote procedure call method provided by an embodiment of the present disclosure, after step S600, further includes:

[0070] S800: Determine the address to be allocated after the first address of the available space as the next first address of the available space.

[0071] Specifically, the embodiment of the present disclosure can modify the address to be allocated of the memory partition to return to the end of the memory image, so that the address to be allocated is the first address of the next available space, so that when the thread obtains a data service request again, the next available space first address and the data service request are sent to the server.

[0072] S700: When all data objects corresponding to each data service request are stored in the memory space, process each data object in the memory space to obtain a data object processing result, and send the data object processing result to the requesting party.

[0073] Specifically, the embodiment of the present disclosure can integrate and process the data objects in the memory space, and send the processed data object processing results as service results to the requesting party.

[0074] The data object-oriented remote procedure call method provided by the disclosed embodiments supports multiple concurrent remote calls, not only reducing the overall system response time but also alleviating hardware upgrade pressures and performance issues caused by data growth by horizontally scaling servers. Furthermore, it is applicable not only between business modules and data modules within an application system but also to distributed computing. It can split tasks requiring extensive computation into independent, parallelizable small tasks, then dispatch multiple computers to perform separate computations using multi-threaded concurrent remote procedure calls, ultimately merging the complex computational results to produce the final result.

[0075] The present disclosure provides a data object-oriented remote procedure call method, which is applied to a client and can obtain a business request sent by a requester; generate multiple data service requests corresponding to the business request based on the business logic of the business request; allocate memory space corresponding to a reserved address according to the number of threads to be started, and allocate a corresponding memory partition for each thread in the memory space, wherein the reserved address is a mapping address corresponding to a virtual memory area pre-agreed between the client and the server based on a memory mapping mechanism; when any thread obtains a data service request, the next available space first address of the memory partition corresponding to the thread and the data service request are sent to the server, so that the server reads the data at the available space first address, processes the data in response to the data service request, and returns a data object obtained after the data processing; creates an anonymous memory area on the memory partition using the next available space first address; when a data object is obtained, stores the data object in the anonymous memory area; when the data objects corresponding to each data service request are stored in the memory space, processes each data object in the memory space to obtain a data object processing result, and sends the data object processing result to the requester. The present disclosure utilizes a memory mapping mechanism to implement deserialization of remote procedure calls, so that data objects are completely consistent memory images in both client and server processes. Memory address partition management is also used to ensure that the address spaces used by the client and server for data objects are completely consistent, thus avoiding address conflicts. This improves the efficiency of remote procedure calls of data objects and ensures the reliability of application systems after migration to cloud computing platforms.

[0076] Although the operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.

[0077] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0078] Corresponding to the above method embodiment, the embodiment of the present disclosure also provides a data object-oriented remote procedure call device, whose structure is as follows: Figure 6 As shown, applied to the client, the device may include: a business request obtaining unit 100, a data service request generating unit 200, a memory space allocating unit 300, a request parameter sending unit 400, a memory area creating unit 500, a data object storage unit 600 and a data object processing result obtaining unit 700.

[0079] The service request obtaining unit 100 is configured to obtain a service request sent by a requester.

[0080] The data service request generating unit 200 is configured to generate a plurality of data service requests corresponding to the service request according to the service logic of the service request.

[0081] The memory space allocation unit 300 is used to allocate the memory space corresponding to the reserved address according to the number of threads started, and allocate a corresponding memory partition for each thread in the memory space, wherein the reserved address is the mapping address corresponding to the virtual memory area pre-agreed by the client and the server based on the memory mapping mechanism.

[0082] The request parameter sending unit 400 is used to send the next available space starting address and the data service request of the memory partition corresponding to any thread to the server when the thread obtains a data service request, so that the server can read the data on the first address of the available space, respond to the data service request, perform data processing, and return the data object obtained after data processing.

[0083] The memory area creating unit 500 is used to create an anonymous memory area on the memory partition using the first address of the next available space.

[0084] The data object storage unit 600 is used to store the data object in the anonymous memory area when the data object is obtained.

[0085] The data object processing result obtaining unit 700 is used to process each data object in the memory space, obtain the data object processing result, and send the data object processing result to the requester when the data objects corresponding to each data service request are stored in the memory space.

[0086] Optionally, the memory area creation unit 500 is specifically used to perform memory address partition management on the memory partition using a memory allocation algorithm in a preset memory allocator, and create an anonymous memory area corresponding to the first address of the next available space on the memory partition.

[0087] Optionally, the device may further include: an available space first address determining unit,

[0088] The available space first address determination unit is used for the data object storage unit 600 to store the data object in the anonymous memory area corresponding to the available space first address in the memory partition when obtaining the data object, and then determine the address to be allocated after the available space first address as the next available space first address.

[0089] Optionally, when receiving multiple data service requests, the server responds to each data service request in sequence, and after completing data processing for one data service request, it processes data for another data service request.

[0090] The present disclosure provides a data object-oriented remote procedure call device, which is applied to a client and can obtain a business request sent by a requester; generate multiple data service requests corresponding to the business request based on the business logic of the business request; allocate memory space corresponding to a reserved address according to the number of threads to be started, and allocate a corresponding memory partition for each thread in the memory space, wherein the reserved address is a mapping address corresponding to a virtual memory area pre-agreed by the client and the server based on a memory mapping mechanism; when any thread obtains a data service request, the device sends the next available space first address of the memory partition corresponding to the thread and the data service request to the server, so that the server reads the data at the available space first address, processes the data in response to the data service request, and returns the data object obtained after the data processing; creates an anonymous memory area on the memory partition using the next available space first address; when a data object is obtained, stores the data object in the anonymous memory area; when the data objects corresponding to each data service request are stored in the memory space, processes each data object in the memory space to obtain a data object processing result, and sends the data object processing result to the requester. The present disclosure utilizes a memory mapping mechanism to implement deserialization of remote procedure calls, so that data objects are completely consistent memory images in both client and server processes. Memory address partition management is also used to ensure that the address spaces used by the client and server for data objects are completely consistent, thus avoiding address conflicts. This improves the efficiency of remote procedure calls of data objects and ensures the reliability of application systems after migration to cloud computing platforms.

[0091] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0092] The data object-oriented remote procedure call device includes a processor and a memory. The above-mentioned business request obtaining unit 100, data service request generating unit 200, memory space allocation unit 300, request parameter sending unit 400, memory area creation unit 500, data object storage unit 600 and data object processing result obtaining unit 700 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0093] The processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be set up. By adjusting kernel parameters, a memory mapping mechanism is used to implement deserialization of remote procedure calls, ensuring that data objects are completely identical memory images in both client and server processes. Memory address partitioning is also used to ensure that the address space used by the client and server for data objects is completely consistent, avoiding address conflicts. This improves the efficiency of remote procedure calls for data objects and ensures the reliability of application systems after migration to cloud computing platforms.

[0094] An embodiment of the present disclosure provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, the data object-oriented remote procedure call method is implemented.

[0095] An embodiment of the present disclosure provides a processor, which is used to run a program, wherein the program executes the data object-oriented remote procedure call method when running.

[0096] An embodiment of the present disclosure provides an electronic device, which includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the data object-oriented remote procedure call method.

[0097] like Figure 7 As shown, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. Various programs and data required for the operation of the electronic device 1000 are also stored in the RAM 1003. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0098] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. Figure 7The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0099] The present disclosure also provides a computer program product, which, when executed on an electronic device, is adapted to execute a program initiated with the steps of the data object oriented remote procedure call method.

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

[0101] In a typical configuration, an electronic device includes one or more processors (CPUs), a memory, and a bus. The electronic device may also include an input / output interface, a network interface, and the like.

[0102] Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory includes at least one memory chip. Memory is an example of a computer-readable medium.

[0103] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0104] In the description of the present disclosure, it should be understood that if the terms "up", "down", "front", "back", "left" and "right" are used to indicate directions or positional relationships, they are based on the directions or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the positions or elements referred to must have a specific direction, be constructed and operate in a specific direction. Therefore, they should not be understood as limitations of the present disclosure.

[0105] Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as methods, systems, or computer program products. Thus, the present disclosure may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0106] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

[0107] Although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented in multiple embodiments individually or in any suitable sub-combination.

[0108] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

Claims

1. A data object-oriented remote procedure call method, characterized in that: Applied to a client, the method includes: Obtaining the service request sent by the requester; generating, according to the business logic of the business request, a plurality of data service requests corresponding to the business request; Allocate the memory space corresponding to the reserved address according to the number of threads started, and allocate a corresponding memory partition for each thread in the memory space, wherein the reserved address is a mapping address corresponding to the virtual memory area pre-agreed by the client and the server based on a memory mapping mechanism; When any of the threads obtains the data service request, the server sends the next available space first address of the memory partition corresponding to the thread and the data service request to the server, so that the server reads the data at the first address of the available space, processes the data in response to the data service request, and returns a data object obtained after the data processing; Creating an anonymous memory area on the memory partition using the first address of the next available space; When the data object is obtained, the data object is stored in the anonymous memory area; In a case where the data objects corresponding to each data service request are stored in the memory space, each data object in the memory space is processed to obtain a data object processing result, and the data object processing result is sent to the requesting party.

2. The method according to claim 1, characterized in that The step of creating an anonymous memory area on the memory partition by using the first address of the next available space includes: The memory partition is managed by using a memory allocation algorithm in a preset memory allocator, and an anonymous memory area corresponding to the first address of the next available space is created on the memory partition.

3. The method according to claim 1, characterized in that In the case of obtaining the data object, after storing the data object in the anonymous memory area corresponding to the first address of the available space in the memory partition, the method further includes: The address to be allocated after the first address of the available space is determined as the next first address of the available space.

4. The method according to claim 1, wherein When receiving multiple data service requests, the server responds to each of the data service requests in sequence, and after completing data processing for one data service request, it processes data for another data service request.

5. A data object-oriented remote procedure call device, characterized in that: Applied to a client, the device comprises: a service request obtaining unit, a data service request generating unit, a memory space allocating unit, a request parameter sending unit, a memory area creating unit, a data object storing unit and a data object processing result obtaining unit. The service request obtaining unit is used to obtain the service request sent by the requester; The data service request generating unit is configured to generate a plurality of data service requests corresponding to the service request according to the service logic of the service request; The memory space allocation unit is configured to allocate the memory space corresponding to the reserved address according to the number of threads started, and allocate a corresponding memory partition to each thread in the memory space, wherein the reserved address is a mapping address corresponding to a virtual memory area pre-agreed by the client and the server based on a memory mapping mechanism; The request parameter sending unit is configured to, when any of the threads obtains the data service request, send the next available space first address of the memory partition corresponding to the thread and the data service request to the server, so that the server reads the data at the first address of the available space, performs data processing in response to the data service request, and returns a data object obtained after the data processing; The memory area creation unit is used to create an anonymous memory area on the memory partition using the first address of the next available space; The data object storage unit is configured to store the data object in the anonymous memory area when the data object is obtained; The data object processing result obtaining unit is used to process each data object in the memory space, obtain a data object processing result, and send the data object processing result to the requesting party when the data objects corresponding to each data service request are stored in the memory space.

6. The device according to claim 5, characterized in that The memory area creation unit is specifically used to use the memory allocation algorithm in the preset memory allocator to perform memory address partition management on the memory partition, and create an anonymous memory area corresponding to the first address of the next available space on the memory partition.

7. The device according to claim 5, characterized in that Also includes: The first address of the available space determines the unit, The available space first address determination unit is used for the data object storage unit to store the data object in the anonymous memory area corresponding to the available space first address in the memory partition when obtaining the data object, and then determine the address to be allocated after the available space first address as the next available space first address.

8. The device according to claim 5, characterized in that When receiving multiple data service requests, the server responds to each of the data service requests in sequence, and after completing data processing for one data service request, it processes data for another data service request.

9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the data object-oriented remote procedure call method according to any one of claims 1 to 4 is implemented.

10. An electronic device comprising at least one processor, and at least one memory and a bus connected to the processor; wherein: The processor and the memory communicate with each other via the bus; The processor is configured to call program instructions in the memory to execute the data object-oriented remote procedure call method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Remote file access method for distributed memory file system

    CN107493329A

  • Data transmission method and system

    CN113641604A