Data transmission method and data transmission device for remote procedure call
Through comparison of the data -blocking and hash value of the data called remote process, transmitting hash numbers rather than actual data, the problem of data transmission bandwidth under high frequency calls is solved, and more efficient data transmission is achieved.
Patent Information
- Application Number
- CN202411381700.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-28
AI Technical Summary
Remote procedure call In scenarios with high frequency call, frequent data transmission leads to high network bandwidth pressure, especially when transmitting duplicate or similar data.
A data transmission method is proposed to calculate its hash value for each segmentation data by treating transmission data. Then compare with the hash values in the cache. If equal, the transmission hash number is not divided into block data, thereby reducing the amount of data transmission.
Through the comparison of hash values and cache mechanisms, the amount of data transmission is reduced, the pressure of network bandwidth is reduced, and the high frequency calling efficiency of the remote process calls is improved.
Smart Images

Figure CN119383213A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote procedure calls, and in particular to a data transmission method and data transmission device, an electronic device and a non-transient computer-readable storage medium for remote procedure calls. Background Art
[0002] Remote Procedure Call (RPC) is a commonly used communication protocol that allows programs to transmit data between different hosts.
[0003] In the scenario of high-frequency remote procedure calls, frequent data transmission will cause great pressure on network bandwidth. This pressure is particularly obvious when the amount of data transmitted is large or similar data content is repeatedly called. Summary of the invention
[0004] The present invention aims to propose a data transmission method and data transmission device, an electronic device and a non-transient computer-readable storage medium for remote procedure calls, so as to solve the problem of high network bandwidth pressure caused by remote procedure calls when transmitting repeated or similar data.
[0005] According to one aspect of the present invention, a data transmission method for remote procedure call is proposed, which is applied to a data sending end and includes: in response to a data transmission instruction, performing block processing on data to be transmitted to obtain multiple block data, wherein the multiple block data include first block data; performing hash calculation on the first block data to obtain a first hash value corresponding to the first block data; comparing the first hash value with a second hash value pre-stored in a cache; and when the first hash value and the second hash value are equal, transmitting a first hash number corresponding to the first hash value instead of transmitting the first block data.
[0006] According to some embodiments, the data transmission method further includes: storing the first hash value and the first block data corresponding to the first hash value in the cache accordingly.
[0007] According to some embodiments, the data transmission method further includes: setting a corresponding relationship between the first hash value and the first block data in the cache.
[0008] According to some embodiments, setting the correspondence between the first hash value and the first block data in the cache includes: setting a unique hash number for the first hash value; using the hash number to establish a mapping table for the first hash value and the first block data corresponding to the first hash value; and storing the mapping table in the cache.
[0009] According to some embodiments, before comparing the first Hash value with the second Hash value pre-stored in the cache, it also includes: counting the number of transmissions of the historical block data stored in the cache; and deleting the historical block data in the cache whose transmission times are less than a preset transmission times threshold.
[0010] According to some embodiments, the data transmission method further includes: synchronizing the mapping table and the corresponding historical block data to a receiver, so that the receiver obtains the corresponding historical block data according to the mapping table and the hash number.
[0011] According to one aspect of the present invention, a data transmission method for remote procedure call is proposed, which is applied to a data receiving end, and includes: receiving a first hash number corresponding to a first block data in response to a block data receiving instruction; obtaining the first block data corresponding to the first hash number from a cache; and obtaining the transmission data sent by the sending end using the first block data.
[0012] According to some embodiments, before obtaining the first block data corresponding to the first hash number from the cache, it also includes: receiving a mapping table sent by the sending end; storing the mapping table in the cache; wherein the cache also stores historical block data, and the mapping table is used to store the mapping relationship between the historical block data, the historical hash value corresponding to the historical block data, and the hash number.
[0013] According to some embodiments, obtaining first block data corresponding to the first hash number from a cache includes: obtaining the first block data corresponding to the first hash number using the mapping table according to the first hash number.
[0014] According to one aspect of the present invention, a data transmission device for remote procedure calls is proposed, comprising: a data blocking unit, for responding to a data transmission instruction, to block data to be transmitted to obtain a plurality of block data, wherein the plurality of block data include a first block data; a hash calculation unit, for performing a hash calculation on the first block data to obtain a first hash value corresponding to the first block data; a hash value comparison unit, for comparing the first hash value with a second hash value pre-stored in a cache; and a data transmission unit, for transmitting a first hash number corresponding to the first hash value instead of transmitting the first block data when the first hash value and the second hash value are equal.
[0015] According to one aspect of the present invention, a data transmission device for remote procedure call is proposed, comprising: a data receiving unit, for receiving a first hash number corresponding to a first block data in response to a block data receiving instruction; a block data acquisition unit, for acquiring the first block data corresponding to the first hash number from a cache; and a data splicing unit, for obtaining the transmission data sent by the sending end using the first block data.
[0016] According to one aspect of the present invention, an electronic device is provided, comprising: a processor; and a memory storing a computer program, wherein when the computer program is executed by the processor, the processor executes the data transmission method as described in any of the preceding embodiments.
[0017] According to one aspect of the present invention, a non-transitory computer-readable storage medium is provided, on which computer-readable instructions are stored. When the instructions are executed by a processor, the processor executes the data transmission method as described in any of the previous embodiments.
[0018] According to an embodiment of the present invention, before transmitting data, the transmitted data is first divided into blocks, and a hash value of each block of data is calculated; then, the calculated hash value is compared with a hash value cached in a buffer; when the two are the same, a hash number corresponding to the block data is sent to the receiving end to replace the transmission of the block data, thereby reducing the amount of data transmission and reducing the pressure on the network bandwidth.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. By describing the exemplary embodiments in detail with reference to the drawings, the above and other objectives, features and advantages of the present invention will become more apparent.
[0021] Figure 1 A flow chart of a data transmission method for remote procedure call according to an exemplary embodiment of the present invention is shown.
[0022] Figure 2 A flow chart of another data transmission method for remote procedure call according to an exemplary embodiment of the present invention is shown.
[0023] Figure 3 A flow chart of another data transmission method for remote procedure call according to an exemplary embodiment of the present invention is shown.
[0024] Figure 4A block diagram of a data transmission device for remote procedure call according to an exemplary embodiment of the present invention is shown.
[0025] Figure 5 A block diagram of another data transmission device for remote procedure call according to an exemplary embodiment of the present invention is shown.
[0026] Figure 6 An electronic device according to an exemplary embodiment of the present invention is shown. DETAILED DESCRIPTION
[0027] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present invention will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same figures in the drawings represent the same or similar parts, and thus their repeated description will be omitted.
[0028] The described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of these specific details, or other modes, components, materials, devices or operations may be adopted. In these cases, known structures, methods, devices, implementations, materials or operations will not be shown or described in detail.
[0029] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0030] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0031] As mentioned above, in the scenario of high-frequency remote procedure calls, frequent data transmission will cause great pressure on network bandwidth. This pressure is particularly obvious when the amount of data transmitted is large or similar data content is repeatedly called.
[0032] The inventor of the present invention has found that the structured data carried by the same RPC interface often has great similarity. Therefore, the present invention proposes a data transmission method and data transmission device for remote procedure call, an electronic device and a non-transient computer-readable storage medium.
[0033] According to an embodiment of the present invention, before transmitting data, the transmitted data is first divided into blocks, and the hash value of each block data is calculated. Then, the calculated hash value is compared with the hash value cached in the buffer; when the two are the same, the hash number corresponding to the block data is sent to the receiving end to replace the transmission of the block data, thereby reducing the amount of data transmission and reducing the pressure on the network bandwidth.
[0034] The specific embodiments according to the present invention are described in detail below with reference to the accompanying drawings.
[0035] Figure 1 The flowchart of a data transmission method for remote procedure call according to an exemplary embodiment of the present invention is shown. In the embodiment of the present invention, the sending end sends data to the receiving end through the remote procedure call. Figure 1 The method shown is applied to the data sending end. Figure 1 The data transmission method shown includes steps S101, S103, S105 and S107. Figure 1 Taking as an example, a data transmission method for remote procedure call according to an exemplary embodiment of the present invention is described in detail.
[0036] like Figure 1 As shown, in step S101, in response to a data transmission instruction, data to be transmitted is processed in blocks to obtain a plurality of block data, wherein the plurality of block data include a first block data.
[0037] In practice, the data to be transmitted may be processed in blocks according to preset rules, which are not specifically limited in the present invention.
[0038] For example, according to the size of the data to be transmitted, the data to be transmitted is equally divided according to a preset data block length.
[0039] For another example, according to network transmission requirements, such as network bandwidth limitations, the data to be transmitted is divided into blocks.
[0040] In step S103, a hash calculation is performed on the first block data to obtain a first hash value corresponding to the first block data.
[0041] According to an embodiment of the present invention, after obtaining the first hash value corresponding to the first block data, the first hash value and the first block data corresponding to the first hash value are stored in the cache of the sending end, so as to judge whether the transmitted data is the same as the first block data based on the calculation of the first hash value.
[0042] In step S105, the first Hash value is compared with a second Hash value pre-stored in the cache.
[0043] According to an embodiment of the present invention, before step S101, if no data has been transmitted, the cache does not store the block data and the corresponding hash value. Before step S101, if historical data has been transmitted, before step S105, the method shown in 1 further includes:
[0044] First, the historical transmission data is processed in blocks in the cache to obtain historical block data;
[0045] Then, hash calculation is performed on each historical block data to obtain the historical hash value corresponding to each historical block data;
[0046] Finally, the historical hash value and the historical block data corresponding to the historical hash value are stored in the cache; wherein the historical block data includes the first block data, and the historical hash value includes the second hash value.
[0047] In step S107, when the first Hash value and the second Hash value are equal, the first Hash number corresponding to the first Hash value is transmitted instead of transmitting the first block data.
[0048] According to an embodiment of the present invention, before step S107, it is also necessary to set the correspondence between the first hash value and the first block data in the cache of the sending end. The setting of the correspondence between the first hash value and the first block data in the cache includes:
[0049] First, a unique hash number is set for the first hash value; then, a mapping table is established for the first hash value and the first block data corresponding to the first hash value using the hash number; finally, the mapping table is stored in a cache.
[0050] For example, when historical data has been transmitted before step S101, a unique hash number is set for the historical hash value corresponding to each historical block data of the historical transmission data, and then a mapping table is established using the unique hash number, the historical block data, and the historical hash value corresponding to each historical block data, and the mapping table is stored in the cache. The historical block data includes the first block data, and the historical hash value includes the second hash value. When the historical hash value corresponding to the first hash value is retrieved from the historical hash value in step S107, only the hash number corresponding to the retrieved historical hash value is transmitted to replace the transmission of the first block data, thereby saving the amount of data transmission and reducing the pressure on network bandwidth.
[0051] according to Figure 1 In the embodiment shown, before transmitting data, the transmitted data is first divided into blocks and the hash value of each block data is calculated; then, the calculated hash value is compared with the hash value cached in the buffer; when the two are the same, the hash number corresponding to the block data is sent to the receiving end to replace the transmission of the block data, thereby reducing the amount of data transmission and reducing the pressure on the network bandwidth.
[0052] Figure 2 A flow chart of another data transmission method for remote procedure call according to an exemplary embodiment of the present invention is shown. Figure 1 compared to, Figure 2 The method shown also includes step S109. For the sake of simplicity, only step S109 is described here. Figure 1 and Figure 1 The differences between the two will not be repeated here.
[0053] In order to alleviate the storage pressure of the cache area, such as Figure 2 As shown, Figure 1 The method shown also includes step S109, counting the transmission times of the historical block data stored in the cache, and deleting the historical block data in the cache whose transmission times are less than a preset transmission times threshold.
[0054] In practice, the preset transmission number threshold can be set according to the size of the buffer area and is not limited here.
[0055] In other embodiments, step S107 may be executed regularly, and may be executed when the remaining space in the cache area is less than a preset remaining space threshold, which is not specifically limited here.
[0056] It should also be noted that the present invention does not limit the execution time of step S107. In this embodiment, step S107 is executed after step S105. In other examples, step S107 may also be executed before or after steps S101 to S105.
[0057] According to an embodiment of the present invention, before or after the sending end sends a hash number to the receiving end to replace the transmission of block data, it is also necessary to synchronize the mapping table and the corresponding historical block data to the receiving end so that the receiving end can find the block data corresponding to the hash number according to the sent mapping table.
[0058] In practice, for block data whose transmission times are greater than the preset times threshold, since the corresponding hash number has been stored at the receiving end, there is no need to synchronize the mapping table and the corresponding historical block data. However, for block data whose transmission times are less than the preset times threshold, it is necessary to synchronize the mapping table and the corresponding historical block data so that the receiving end can retrieve the corresponding block data according to the mapping table.
[0059] For example, when the block data is transmitted for the first time, the block data and the corresponding hash number need to be transmitted. The sending end stores the block data, the hash number and the corresponding hash value in its buffer at the same time. When the receiving end receives the block data, it stores the block data, the hash number and the corresponding hash value. The receiving end and the sending end synchronize the mapping table and the block data. When the block data needs to be transmitted again in the future, only the hash number of the block data needs to be transmitted, and the receiving end can find the corresponding block data according to the required number.
[0060] Figure 3 Another data transmission method flow chart for remote procedure call according to an exemplary embodiment of the present invention is shown. In the embodiment of the present invention, the sending end sends data to the receiving end through the remote procedure call, and the receiving end receives the data sent by the sending end. Figure 3 The method shown is applied to the data receiving end. Figure 3 The data transmission method shown includes steps S301, S303 and S305.
[0061] like Figure 3 As shown, in step S301, in response to a block data receiving instruction, a first hash number corresponding to a first block data is received.
[0062] When the sending end sends the first hash number to the receiving end instead of sending the first block data, the receiving end receives the first hash number corresponding to the first block data according to the block data receiving instruction.
[0063] In step S303, the first block data corresponding to the first hash number is obtained from the cache.
[0064] According to an embodiment of the present invention, before step S303, the receiving end also needs to receive the mapping table sent by the sending end and store the mapping table in the cache. The cache also stores historical block data, and the mapping table is used to store the mapping relationship between the historical block data, the historical hash value corresponding to the historical block data, and the hash number. When the receiving end executes step S303, according to the first hash number, the first block data corresponding to the first hash number is obtained from the cache. That is, according to the first hash number, the first block data corresponding to the first hash number is obtained using the mapping table.
[0065] In step S305, the transmission data sent by the transmitting end is obtained by using the first block data.
[0066] According to an embodiment of the present invention, after the receiving end obtains all the block data, it splices the block data in the splicing order to obtain the data to be transmitted in step S101. The splicing order can be determined according to the sending order of the sending end.
[0067] according to Figure 3 In the embodiment shown, the receiving end uses the cached hash number and block data and the corresponding relationship between the two to obtain the corresponding block data according to the received hash number, thereby finally obtaining the data to be transmitted by the sending end. The whole process not only reduces the amount of data transmission, but also reduces the pressure on network bandwidth.
[0068] The above mainly introduces the embodiments of the present invention from the perspective of methods. Those skilled in the art should easily appreciate that, in combination with the operations or steps of each example described in the embodiments disclosed herein, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Those skilled in the art may use different ways to implement the described functions for each specific operation or method, and such implementation should not be considered to exceed the scope of the present invention.
[0069] The following describes the device embodiment of the present invention. For details not described in the device embodiment of the present invention, reference can be made to the method embodiment of the present invention.
[0070] Figure 4 A block diagram of a data transmission device for remote procedure call according to an exemplary embodiment of the present invention is shown. Figure 4The data transmission device shown includes a data block unit 401, a hash calculation unit 403, a hash value comparison unit 405 and a data transmission unit 407. The data block unit 401 is used to respond to the data transmission instruction, block the data to be transmitted, and obtain multiple block data, wherein the multiple block data include first block data; the hash calculation unit 403 is used to perform hash calculation on the first block data to obtain a first hash value corresponding to the first block data; the hash value comparison unit 405 is used to compare the first hash value with a second hash value pre-stored in a cache; the data transmission unit 407 is used to transmit the first hash number corresponding to the first hash value instead of transmitting the first block data when the first hash value and the second hash value are equal.
[0071] Figure 5 FIG. 4 shows another block diagram of a data transmission device for remote procedure call according to an exemplary embodiment of the present invention. Figure 5 The data transmission device shown includes a data receiving unit 501, a block data acquisition unit 503 and a data splicing unit 505. The data receiving unit 501 is used to receive a first hash number corresponding to a first block data in response to a block data receiving instruction; the block data acquisition unit 503 is used to acquire the first block data corresponding to the first hash number from a cache; and the data splicing unit 505 is used to obtain the transmission data sent by the sending end using the first block data.
[0072] Figure 6 An electronic device according to an exemplary embodiment of the present invention is shown. Figure 6 The electronic device 200 according to this embodiment of the present invention will be described. Figure 6 The electronic device 200 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0073] like Figure 6 As shown, the electronic device 200 is in the form of a general computing device. The components of the electronic device 200 may include, but are not limited to: at least one processing unit 210, at least one storage unit 220, a bus 230 connecting different system components (including the storage unit 220 and the processing unit 210), a display unit 240, etc.
[0074] The storage unit stores program codes, which can be executed by the processing unit 210, so that the processing unit 210 executes the methods according to various exemplary embodiments of the present invention described in this specification. For example, the processing unit 210 can execute the following Figure 1 The method shown in .
[0075] The storage unit 220 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 2201 and / or a cache memory unit 2202 , and may further include a read-only memory unit (ROM) 2203 .
[0076] The storage unit 220 may also include a program / utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0077] Bus 230 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0078] The electronic device 200 may also communicate with one or more external devices 300 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 200, and / or communicate with any device that enables the electronic device 200 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 250. Furthermore, the electronic device 200 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 260. The network adapter 260 may communicate with other modules of the electronic device 200 via the bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0079] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. The technical solution according to the implementation method of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation method of the present invention.
[0080] The software product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0081] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0082] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0083] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the computer-readable medium implements the aforementioned functions.
[0084] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
[0085] According to an embodiment of the present invention, a computer program is provided, including a computer program or an instruction. When the computer program or the instruction is executed by a processor, the method described above can be executed.
[0086] The embodiments of the present invention are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present invention, the specific implementation methods and application scope of the present invention, all belong to the scope of protection of the present invention. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A data transmission method for remote procedure call, applied to a data sending end, characterized in that: include: In response to the data transmission instruction, the data to be transmitted is processed into blocks to obtain a plurality of block data, wherein the plurality of block data includes the first block data; Performing a hash calculation on the first block data to obtain a first hash value corresponding to the first block data; Comparing the first Hash value with a second Hash value pre-stored in a cache; When the first Hash value is equal to the second Hash value, a first Hash number corresponding to the first Hash value is transmitted instead of transmitting the first block data.
2. The data transmission method according to claim 1, characterized in that: Also includes: Correspondingly storing the first Hash value and the first block data corresponding to the first Hash value in the cache; and / or A correspondence between the first hash value and the first block data is set in the cache.
3. The data transmission method according to claim 2, characterized in that: Setting a correspondence between the first hash value and the first block data in the cache includes: Setting a unique hash number for the first hash value; Using the hash number, establishing a mapping table for the first hash value and the first block data corresponding to the first hash value; The mapping table is stored in the cache.
4. The data transmission method according to claim 2, characterized in that: Before comparing the first Hash value with the second Hash value pre-stored in the cache, the method further includes: Counting the number of transmissions of the historical block data stored in the cache; The historical block data in the cache whose transmission times are less than a preset transmission times threshold is deleted.
5. The data transmission method according to claim 3, characterized in that: Also includes: The mapping table and the corresponding historical block data are synchronized to a receiving party, so that the receiving party obtains the corresponding historical block data according to the mapping table and the hash number.
6. A data transmission method for remote procedure call, applied to a data receiving end, characterized in that: include: In response to the block data receiving instruction, receiving a first hash number corresponding to the first block data; Acquire first block data corresponding to the first hash number from the cache; The transmission data sent by the sending end is obtained by using the first block data.
7. The data transmission method according to claim 6, characterized in that: Before obtaining the first block data corresponding to the first hash number from the cache, the method further includes: Receive the mapping table sent by the sender; Storing the mapping table in a cache; The cache also stores historical block data, and the mapping table is used to store the mapping relationship between the historical block data, the historical hash value corresponding to the historical block data, and the hash number.
8. The data transmission method according to claim 7, characterized in that: Acquiring first block data corresponding to the first hash number from the cache includes: According to the first Hash number, using the mapping table, first block data corresponding to the first Hash number is obtained.
9. An electronic device, comprising: processor; as well as A memory storing a computer program, which, when executed by the processor, enables the processor to execute the data transmission method according to any one of claims 1 to 8.
10. A non-transitory computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor, causes the processor to execute the data transmission method according to any one of claims 1 to 8.