Message transmission methods and apparatuses, nonvolatile readable storage medium and electronic apparatus
By reconstructing the message memory address and using the address identification value to replace the original address, the problem of low message transmission efficiency in inter-process communication is solved and the message transmission efficiency is improved.
Patent Information
- Application Number
- PCT/CN2024/079088
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-03
- Filing Date
- 2024-02-28
- Publication Date
- 2024-09-12
AI Technical Summary
The transmission efficiency of inter-process communication messages in the existing technology is low, mainly due to the increased resource consumption and impact on transmission performance caused by excessively long messages.
By reconstructing the format of the message memory address, using the base address and address unit size to determine the address identification value, and writing it into the message structure, the space occupied by the transmitted memory address in the message is reduced, thereby shortening the message length and improving transmission. efficiency.
It effectively compresses the space occupied by the memory address in the message, improves the message transmission efficiency, and solves the problem of low transmission efficiency caused by too long messages.
Smart Images

Figure CN2024079088_12092024_PF_FP_ABST
Abstract
Description
Message transmission method and device, non-volatile readable storage medium and electronic device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on March 3, 2023, with application number 2023101991640, and application name “Message Transmission Method and Device, Storage Medium and Electronic Device”, all contents of which are incorporated by reference into this application. Technical Field
[0003] The embodiments of the present application relate to the field of computers, and in particular, to a message transmission method and device, a non-volatile readable storage medium, and an electronic device. Background Art
[0004] Currently, communication between different FUs (Function Units) usually uses inter-process communication (IPC) messages as the basic unit. Each IPC message contains several parameters, of which memory addresses occupy a large number of bits.
[0005] However, with the development of NAND (Not AND, i.e. computer flash memory devices) technology, the number of memory addresses that need to be transmitted in a multi-plane (i.e., storage matrix) read and write message is increasing, and the length of IPC messages is also increasing accordingly, resulting in an increase in the resources consumed when reading and writing IPC messages, thereby affecting the message transmission efficiency.
[0006] It can be seen that the method for transmitting inter-process communication messages in the related art has the problem of low message transmission efficiency due to the excessive length of the messages to be transmitted.
[0007] Summary of the Invention
[0008] The embodiments of the present application provide a message transmission method and device, a non-volatile readable storage medium and an electronic device, so as to at least solve the problem of low message transmission efficiency caused by the excessive length of the message to be transmitted in the transmission method of inter-process communication messages in the related art.
[0009] According to one embodiment of the present application, a message transmission method is provided, including: obtaining a target memory address, wherein the target memory address is a buffer address of a target buffer transmitted by a target transmission message to be transmitted; determining an identification value of an address identifier corresponding to the target memory address based on a base address and an address unit size to obtain a target identification value; writing the target identification value into a message structure of the target transmission message, and transmitting the target transmission message to a receiving end of the target transmission message.
[0010] According to another aspect of an embodiment of the present application, a message transmission method is also provided, including: receiving a target transmission message sent by a sending end; extracting a target identification value from a message structure of the target transmission message, wherein the target identification value is an identification value of an address identifier corresponding to a target memory address; and determining the target memory address based on the target identification value, a base address, and an address unit size.
[0011] According to another embodiment of the present application, a message transmission device is provided, including: a first acquisition unit, configured to obtain a target memory address, wherein the target memory address is a buffer address of a target buffer transmitted by a target transmission message to be transmitted; a first determination unit, configured to determine an identification value of an address identifier corresponding to the target memory address based on a base address and an address unit size, to obtain a target identification value; a first execution unit, configured to write the target identification value into a message structure of the target transmission message, and transmit the target transmission message to a receiving end of the target transmission message.
[0012] According to another embodiment of the present application, a message transmission device is also provided, including: a receiving unit, configured to receive a target transmission message sent by a sending end; an extraction unit, configured to extract a target identification value from a message structure of the target transmission message, wherein the target identification value is an identification value of an address identifier corresponding to a target memory address; and a third determination unit, configured to determine the target memory address based on the target identification value, a base address and an address unit size.
[0013] According to another embodiment of the present application, a non-volatile readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any of the above method embodiments when running.
[0014] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0015] Through the embodiments of the present application, a method of reconstructing the storage format of the memory address stored in the message is adopted, by obtaining the target memory address, wherein the target memory address is the buffer address of the target buffer transmitted by the target transmission message to be transmitted; determining the identification value of the address identifier corresponding to the target memory address according to the base address and the address unit size, and obtaining the target identification value; writing the target identification value into the message structure of the target transmission message, and transmitting the target transmission message to the receiving end of the target transmission message. Since what is stored in the message is not the original memory address, but the identification value corresponding to the memory address determined according to the pre-defined base address and address unit size (which can be used to restore the original memory address according to the base address and the address unit size), the space occupied by the memory address in the message can be effectively compressed, the purpose of shortening the length of the message to be transmitted can be achieved, and the technical effect of improving the message transmission efficiency is achieved, thereby solving the problem of low message transmission efficiency caused by the excessive length of the message to be transmitted in the transmission method of inter-process communication messages in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] FIG1 is a schematic diagram of a hardware environment of a message transmission method according to an embodiment of the present application;
[0017] FIG2 is a flowchart of a message transmission method according to an embodiment of the present application;
[0018] FIG3 is a flowchart of another message transmission method according to an embodiment of the present application;
[0019] FIG4 is a structural block diagram of a message transmission device according to an embodiment of the present application;
[0020] FIG5 is a structural block diagram of another message transmission device according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0022] It should be noted that the terms "first", "second", etc. in the description and claims of the embodiments of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0023] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking operation on a computer terminal as an example, FIG1 is a hardware environment diagram of a message transmission method according to an embodiment of the present application. As shown in FIG1 , the computer terminal may include one or more (only one is shown in FIG1 ) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 configured to store data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input / output device 108 configured to have a communication function. It will be understood by those skilled in the art that the structure shown in FIG1 is only for illustration and does not limit the structure of the above-mentioned computer terminal. For example, the computer terminal may also include more or fewer components than those shown in FIG1 , or have a configuration different from that shown in FIG1 .
[0024] The memory 104 can be configured to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the message transmission method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may include a memory remotely located relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0025] The transmission device 106 is configured to receive or transmit data via a network. Examples of such networks may include wireless networks provided by a computer terminal's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module configured to communicate with the Internet wirelessly.
[0026] According to one aspect of an embodiment of the present application, a message transmission method is provided. Taking the message transmission method of this embodiment performed by a computer terminal as an example, FIG2 is a flowchart of a message transmission method according to an embodiment of the present application. As shown in FIG2 , the process includes the following steps:
[0027] Step S202 : obtaining a target memory address, wherein the target memory address is a buffer address of a target buffer transmitted by a target transmission message to be transmitted.
[0028] The message transmission method in this embodiment can be applied to the scenario of communication between different functional units FU in the same device. For firmware FW (Firmware), the communication between different FUs mainly adopts the inter-process communication method, and different pipelines FIFO (First Input First Output) are defined by FU. As the basic unit of inter-process communication, the length of the IPC message is generally in Dword (Double Word, each word is 2 bytes in length, 32 bits). Each IPC message can contain several Dwords (for example, 16 Dwords), which include parameters such as the message source, message destination, message unique identifier, message type, message address, and multiple buffer addresses (memory addresses used to store data when reading and writing data) that need to be transferred.
[0029] In this embodiment, before transmitting a message between different functional units, a target memory address may be obtained. Here, the target memory address may be the buffer address of the target buffer transmitted by the target transmission message to be transmitted, i.e., the aforementioned buffer address. The target transmission message may be the aforementioned IPC message.
[0030] Step S204: determining the identification value of the address identifier corresponding to the target memory address according to the base address and the address unit size, and obtaining the target identification value.
[0031] In an IPC message, other parameters besides the buffer address are relatively simple, occupying a relatively small number of bits. In a 64-bit operating system, an absolute buffer address contains 64 bits (i.e., occupies 2 Dwords). A typical structure is as follows, where the buffer address occupies 9 Dwords:
[0032] The most basic operations for communication between different FUs and the NCM (Nand Control Manager) process include read, write, and erase. Among them, the speed of read and write is crucial and determines the basic performance of the product. However, with the continuous development of NAND technology, a multi-plane read and write message needs to transmit more buffer addresses. In this case, the length of the IPC message has to increase significantly. When communicating between processes, IPC messages need to be written in one module and read from another module. As the message length increases, more CPU (Central Processing Unit) resources are consumed when reading and writing IPC messages. In addition, the transmission of IPC messages between different FUs sometimes requires multi-layer forwarding. Excessively long IPC messages will also place a heavy burden on the bus during message transmission, thereby affecting transmission performance and transmission efficiency.
[0033] In order to at least solve some of the above problems, in this embodiment, the format of the memory address recorded in the target transmission message can be reconstructed. Instead of directly recording the complete memory address, the identification value corresponding to the memory address is recorded to achieve compression and optimization of the number of Dwords occupied by the memory address in the message structure.
[0034] In this embodiment, the identification value of the address identifier corresponding to the target memory address can be determined based on the base address and the address unit size to obtain the target identification value. Here, the base address can be used as the starting address of the memory address. The target identification value can be used to identify the target memory address.
[0035] Optionally, the target identification value may be related to the base address and the address unit size according to the size of the target memory address. The base address and the address unit size may be pre-set fixed values, that is, the base address and the address unit size corresponding to each memory address may be the same.
[0036] Optionally, the base address and address unit may be set once before each message transmission, or may be completed in a preparation stage such as memory initialization. Accordingly, no matter how many times message transmissions are performed, the base address and address unit may only need to be set once.
[0037] Step S206: write the target identification value into the message structure of the target transmission message, and transmit the target transmission message to the receiving end of the target transmission message.
[0038] The target transmission message to be transmitted may include a message structure, which is a structure for writing the information carried in the message. After obtaining the target identification value, the target identification value can be written into the message structure of the target transmission message, and the target transmission message can be transmitted to the receiving end of the target transmission message. The method of transmitting the target transmission message may include transmitting the message structure of the target transmission message, and may also include transmitting other information of the target transmission message in addition to the message structure. By writing the identification value corresponding to the memory address into the message structure of the transmission message, compared with the method of transmitting the direct address, the purpose of reducing the number of bits occupied by the memory address in the transmission message can be achieved, thereby reducing the length of the transmission message (i.e., the number of bits occupied) and improving bandwidth utilization.
[0039] Here, the message structure of the target transmission message may include multiple parameters, and the order and position of the multiple parameters may be predefined. Each of the multiple parameters may correspond to a field in the message structure, and each parameter may correspond to one or more bits, i.e., occupy one or more bits. The number of bits occupied by each parameter may be fixed or set for different transmission messages. The target memory address may be one of the multiple parameters, and a target identification value may be written to the write location corresponding to the target memory address in the message structure.
[0040] Through the above steps, by obtaining the target memory address, wherein the target memory address is the buffer address of the target buffer transmitted by the target transmission message to be transmitted; determining the identification value of the address identifier corresponding to the target memory address according to the base address and the address unit size, and obtaining the target identification value; writing the target identification value into the message structure of the target transmission message, and transmitting the target transmission message to the receiving end of the target transmission message, it is possible to solve the problem of low message transmission efficiency caused by the excessive length of the message to be transmitted in the transmission method of the inter-process communication message in the related art, thereby achieving the technical effect of improving the message transmission performance.
[0041] In an exemplary embodiment, before determining the identification value of the address identifier corresponding to the target memory address based on the base address and the address unit size, the above method also includes: obtaining the base address and the address unit size, wherein the base address and the address unit size are set during the memory initialization process.
[0042] Before determining the target identifier value, the base address and address unit size may be obtained. The base address and address unit size may be set during memory initialization. Memory initialization refers to initializing the memory that manages data for multiple processes.
[0043] Through this embodiment, the setting of the base address and the address unit is completed during the memory initialization process, which can avoid wasting separate resources for setting the base address and the address unit, thereby improving resource utilization.
[0044] In an exemplary embodiment, the method further includes: setting the minimum value of the buffer address as the base address, and setting the minimum unit between storage addresses as the address unit size.
[0045] When setting the base address and address unit size, you can set the minimum buffer address as the base address and the minimum unit between storage addresses as the address unit size. For example, when initializing memory, define BaseAddr (base address) and UnitSize (address unit size). BaseAddr uses the minimum value of the buffer address used, and UnitSize is the minimum unit between storage addresses.
[0046] Optionally, the address unit size is the length of the address unit (or the number of bits occupied by the address unit), and setting the minimum unit between storage addresses to the address unit size means: setting the size of the minimum unit between storage addresses to the address unit size, and the address unit is the minimum unit between storage addresses.
[0047] Through this embodiment, the minimum value of the buffer address is set as the base address, and the minimum unit between storage addresses is set as the address unit size, which can improve the applicability of the base address and address unit size to all memory addresses.
[0048] In an exemplary embodiment, obtaining the base address and the address unit size includes: reading the base address and the address unit size from a preset register.
[0049] In this embodiment, the base address and address unit size can be stored in a preset register after definition, provided that the hardware supports it. For example, when initializing the memory, the base address and address unit size are set and stored in the preset register. Correspondingly, when transmitting a message, the base address and address unit size can be read from the preset register. Here, the preset register can be a pre-set register that can include a flip-flop with a storage function.
[0050] The preset register may only be allowed to be set, modified, etc. when the memory is initialized, or may not be allowed to be set, modified, etc. during the message transmission process. In this case, after the base address and address unit size are stored in the preset register, the base address and address unit size can be read from the preset register when different sending ends want to transmit messages. Optionally, to avoid information acquisition conflicts, the preset register only allows one process to read data at the same time, and at the same time, other processes are not allowed to read data from the preset register when reading data. Alternatively, the preset register may also allow multiple processes to read data at the same time. In this case, data reading conflicts can be avoided by one or more methods, for example, the information in the preset register is only allowed to be read, and modification is not allowed. This is not limited in this embodiment.
[0051] It should be noted that different processes can read the base address and address unit size from the preset register when transmitting a message, and the base address and address unit size read by different processes can be the same.
[0052] Through this embodiment, by reading the base address and the address unit size from the register, the base address and the address unit size can be easily obtained, thereby improving the convenience of information acquisition.
[0053] In an exemplary embodiment, an identification value of an address identifier corresponding to a target memory address is determined based on a base address and an address unit size to obtain a target identification value, including: determining an address offset between the target memory address and the base address to obtain a target offset; and determining a target identification value of the address identifier corresponding to the target memory address based on the target offset and the address unit size.
[0054] Since the actual address of the memory address can be determined by the base address and the offset address, when determining the target identification value, considering the unique role of the base address (positioning arrangement), the address offset between the target memory address and the base address can be determined first to obtain the target offset. Then, based on the target offset and the address unit size, the target identification value of the address identifier corresponding to the target memory address is determined. The target offset here can be the difference between the target memory address and the base address, that is, the aforementioned offset address.
[0055] Through this embodiment, the identification value corresponding to the memory address is determined according to the relationship between the offset of the memory address and the base address and the address unit size, which can improve the correlation between the identification value and the memory address and facilitate the acquisition of the memory address of the receiving end of the transmission message.
[0056] In an exemplary embodiment, a target identification value of an address identifier corresponding to a target memory address is determined based on a target offset and an address unit size, including: dividing the target offset by the address unit size to obtain a quotient, and determining the target identification value of the address identifier corresponding to the target memory address.
[0057] In this embodiment, since the address unit size can be the smallest unit between storage addresses, each stored address can be considered to occupy an integer number of address units. That is, the size of each address is an integer multiple of the address unit size. The quotient obtained by dividing the target offset by the address unit size can be determined as the target identifier value of the address identifier corresponding to the target memory address.
[0058] For example, after the sender obtains BufferAddr, it calculates the relative offset of BufferAddr relative to the base address, the offset value bufferId = (BufferAddr-BaseAddr) / UnitSize. The bufferId obtained after the calculation generally does not exceed 12 bits.
[0059] Through this embodiment, the identification value corresponding to the memory address is determined according to the quotient of the offset of the memory address and the base address and the address unit size, which can improve the convenience of determining the identification value.
[0060] In an exemplary embodiment, the method further includes: determining a parameter value of a buffer length parameter corresponding to the target memory address based on a buffer size and an address unit size of the target buffer to obtain a target length value. Correspondingly, writing the target identification value into a message structure of the target transmission message includes: writing the target identification value and the target length value into the message structure of the target transmission message.
[0061] To facilitate the receiver of the target transmission message to accurately determine the complete information of the buffer corresponding to the target memory address, the length value corresponding to the target memory address can also be written into the message structure of the target transmission message. In this embodiment, the parameter value of the buffer length parameter corresponding to the target memory address can be determined based on the buffer size and address unit size of the target buffer to obtain the target length value.
[0062] When writing the target ID value into the message structure of the target transmission message, the target length value can also be written into the message structure of the target transmission message. For example, the sender can fill the obtained bufferId and bufferLength into the IPC message structure.
[0063] Optionally, the target identification value and the target length value can be placed adjacent to each other in the message structure of the target transmission message as a memory address parameter. The target identification value can be placed in front and the target length value in the back, or the target length value can be placed in front and the target identification value in the back, which is not limited in this embodiment. Here, the address identifier can be used to identify the memory address (absolute address) of the buffer, and the buffer length parameter (or buffer length identifier) can be used to identify the buffer size of the buffer. Through these two parameters, the corresponding buffer can be determined.
[0064] Through this embodiment, the length value corresponding to the memory address and the identification value corresponding to the memory address are written into the message structure together, which can improve the boundary of the buffer positioning and provide the accuracy of information transmission.
[0065] In an exemplary embodiment, a parameter value of a buffer length parameter corresponding to a target memory address is determined based on a buffer size and an address unit size of a target buffer to obtain a target length value, including: dividing the buffer size of the target buffer by the address unit size to obtain a quotient, and determining the quotient as the target length value of the buffer length parameter corresponding to the target memory address.
[0066] In this embodiment, when determining the length value corresponding to the target memory address, the quotient obtained by dividing the buffer size of the target buffer by the address unit size can be determined as the target length value of the buffer length parameter corresponding to the target memory address. Here, the length value corresponding to the memory address refers to the length value of the buffer length parameter corresponding to the memory address, that is, it can be used to identify the size of the buffer corresponding to the memory address.
[0067] For example, bufferLength (a parameter that can be used to identify the buffer size) can be obtained by dividing the buffer size to be transmitted by UnitSize, and generally occupies a smaller number of bits.
[0068] Through this embodiment, the quotient of the buffer size and the address unit size of the buffer is determined as the length value written in the message structure, which can facilitate the receiving end to determine the complete buffer information according to the preset address unit size and improve the accuracy of message transmission.
[0069] In an exemplary embodiment, writing the target identification value and the target length value into the message structure of the target transmission message includes: writing the target identification value and the target length value into the message structure of the target transmission message according to the number of bits occupied by the target identification value and the number of bits occupied by the target length value.
[0070] For the determined target identification value and target length value, the number of bits of the two in the message structure of the target transmission message can be determined respectively, and the target identification value and target length value can be written into the message structure of the target transmission message according to the number of bits occupied by the target identification value and the number of bits occupied by the target length value.
[0071] Through this embodiment, writing in the message structure is completed according to the number of bits occupied by the identification value and the length value, which can effectively reduce the number of bits occupied by the memory address in the message structure and achieve the purpose of reducing the message length.
[0072] In an exemplary embodiment, the method further includes: dynamically adjusting the number of bits occupied by the target identification value and the number of bits occupied by the target length value according to the number of bits occupied by the target memory address.
[0073] The number of bits occupied by the target identifier value and the target length value in the message structure of the target transmission message can be dynamically adjusted according to the actual scenario. In this embodiment, the number of bits occupied by the target identifier value and the number of bits occupied by the target length value can be dynamically adjusted according to the number of bits occupied by the target memory address.
[0074] Optionally, the number of bits occupied by the above-mentioned target identification value and the number of bits occupied by the target length can be pre-determined by the sending end and the receiving end based on the current transmission environment and the size of parameters such as the corresponding memory address.
[0075] For example, to facilitate access to information carried in a transmitted message, a Dword can store two sets of bufferId and bufferLength. In this case, more addresses can be stored under the same message length.
[0076] Through this embodiment, by dynamically adjusting the proportion of the identification value and the proportion of the length value, it is possible to transmit more memory addresses without increasing the message length, thereby improving the utilization rate of the message structure.
[0077] In an exemplary embodiment, the number of bits occupied by the target identification value and the number of bits occupied by the target length value are dynamically adjusted according to the number of bits occupied by the target memory address, including: multiplying the number of bits occupied by the target memory address and a preset ratio to determine the number of bits occupied by the target identification value, and determining the difference between the number of bits occupied by the target memory address and the number of bits occupied by the target identification value as the number of bits occupied by the target length value.
[0078] For dynamic adjustment of the proportions of the identifier value and the length value, a ratio can be pre-set, i.e., a preset ratio, and the number of bits occupied by the identifier value and the number of bits occupied by the length value can be calculated based on the preset ratio. In this embodiment, the number of bits occupied by the target identifier value can be determined as the product of the number of bits occupied by the target memory address and the preset ratio, and the number of bits occupied by the target length value can be determined as the difference between the number of bits occupied by the target memory address and the number of bits occupied by the target identifier value.
[0079] For example, when filling the obtained bufferId and bufferLength into the IPC message structure, the number of bits occupied by each can be dynamically adjusted according to the number of bits occupied by the buffer. For example, bufferId occupies 12 bits and bufferLength occupies 4 bits.
[0080] Through this embodiment, the proportions of the identification value and the length value are dynamically adjusted by a preset ratio, which can improve the efficiency of the adjustment and thus improve the efficiency of message transmission.
[0081] In an exemplary embodiment, an identification value of an address identifier corresponding to a target memory address is determined based on a base address and an address unit size to obtain a target identification value, including: when the target memory address contains multiple memory addresses, an identification value of an address identifier corresponding to each of the multiple memory addresses is determined based on the base address and the address unit size to obtain an identification value corresponding to each memory address, wherein the target identification value includes an identification value corresponding to each memory address.
[0082] Since the amount of address information in NAND technology is positively correlated with the capacity of NAND, an IPC message generally includes multiple memory addresses. In this embodiment, when the target memory address includes multiple memory addresses, the aforementioned target identification value may include an identification value corresponding to each memory address. According to the base address and the address unit size, the identification value of the address identification corresponding to each memory address in the multiple memory addresses can be determined respectively to obtain the identification value corresponding to each memory address.
[0083] Optionally, the address offset between the memory address and the base address can be determined in the aforementioned manner of determining the target identification value, and the quotient obtained by dividing the address offset by the address unit size is determined as the identification value of the address identification corresponding to the memory address.
[0084] Optionally, while determining the identification value corresponding to each memory address, the length value corresponding to each memory address can be determined according to the aforementioned method for determining the target length value, and written together with the corresponding identification value into the message structure of the target transmission message.
[0085] Through this embodiment, when there are multiple memory addresses, the identification value corresponding to each memory address is determined based on the base address and the address unit size, which can improve the recognition rate of the receiving end for multiple memory addresses, thereby improving the accuracy of memory address transmission.
[0086] In an exemplary embodiment, obtaining the target memory address includes: obtaining an absolute address of a target buffer to obtain the target memory address.
[0087] To prevent the memory address from becoming invalid due to reasons such as link disconnection during message transmission, in this embodiment, the memory address transmitted in the target transmission message can be an absolute address, that is, the absolute location of the file. Obtaining the target memory address can refer to obtaining the absolute address of the target buffer.
[0088] Through this embodiment, an absolute address is obtained as the memory address to be transmitted, which can avoid address invalidation caused by changes in the connection position and improve the effectiveness of memory address transmission.
[0089] According to another aspect of the embodiments of the present application, a message transmission method is also provided, which can be used to receive and process transmission messages generated and sent by the message transmission method provided in the aforementioned embodiments. Taking the message transmission method of this embodiment executed by a computer terminal as an example, FIG3 is a flow chart of another message transmission method according to an embodiment of the present application. As shown in FIG3, the flow chart includes the following steps:
[0090] Step S302: Receive a target transmission message sent by the sending end.
[0091] In this embodiment, in inter-process communication, a receiving end of a transmission message, for example, a receiving end of a target transmission message, can receive the target transmission message sent by the sending end. Here, the received target transmission message can be generated by the sending end and have a target identification value written into its message structure.
[0092] Step S304: extracting a target identification value from the message structure of the target transmission message, wherein the target identification value is an identification value of an address identifier corresponding to the target memory address.
[0093] After receiving the target transmission message, the receiving end can extract the target identification value from the message structure of the target transmission message. Here, the target identification value can be an identification value of the address identifier corresponding to the target memory address, which can be extracted from a specified field or a specified position of the message structure of the target transmission message. The length of the target identification value can be fixed or variable, and the target identification value can be extracted from a specified field or a specified position of the message structure of the target transmission message based on the number of bits occupied, the end identifier, or other information.
[0094] Optionally, the address identifier of the corresponding target memory address can be determined based on the extracted target identifier value, thereby determining the memory address that the sender wants to transmit.
[0095] Optionally, if the target identification value and the length value corresponding to the target memory address, i.e., the target length value, are written into the message structure at the same time, the corresponding target length value can be extracted at the same time as the target identification value is extracted to determine the buffer zone (i.e., buffer) corresponding to the target memory address based on the target length value and the target length value.
[0096] Step S306: Determine the target memory address according to the target identification value, the base address and the address unit size.
[0097] Optionally, the receiving end may obtain the base address and address unit size in the same or similar manner as the sending end. The obtaining manner may refer to the description of the aforementioned embodiment and will not be elaborated in this embodiment.
[0098] After extracting the target identification value, the target memory address can be determined based on the obtained base address, address unit size, and the target identification value. The method of determining the target memory address can correspond to the method of generating the target memory address in the above embodiment.
[0099] Through the above steps, by receiving the target transmission message sent by the sending end; extracting the target identification value from the message structure of the target transmission message, wherein the target identification value is the identification value of the address identification corresponding to the target memory address; determining the target memory address according to the target identification value, the base address and the address unit size, it is possible to solve the problem of low message transmission efficiency caused by the excessive length of the message to be transmitted in the transmission method of the inter-process communication message in the related art, thereby achieving the technical effect of improving the message transmission performance.
[0100] In an exemplary embodiment, extracting a target identification value from a message structure of a target transmission message includes: determining the number of bits occupied by the target identification value and the number of bits occupied by the target length value, wherein the target length value is the parameter value of the buffer length parameter corresponding to the target memory address, and the target length value is used to identify the buffer size of the target buffer corresponding to the target memory address; extracting the target identification value and the target length value from the message structure of the target transmission message based on the number of bits occupied by the target identification value and the number of bits occupied by the target length value.
[0101] Since the various parameters in the target transmission message can be message structures written in different positions and numbers of bits, when the target identification value and target length value are written in the message structure of the target transmission message, the method for extracting the target identification value and target length value can be to first determine the number of bits occupied by the target identification value and the number of bits occupied by the target length value, and then extract the target identification value and target length value from the message structure of the target transmission message based on the number of bits occupied by the target identification value and the number of bits occupied by the target length value. Here, the target length value is the parameter value of the buffer length parameter corresponding to the target memory address, and the target length value is used to identify the buffer size of the target buffer corresponding to the target memory address.
[0102] Optionally, the number of bits occupied by the target identifier value and the number of bits occupied by the target length value may be sent by the transmitting end to the receiving end simultaneously with the target transmission message. Correspondingly, this may be achieved by, for example, sending the aforementioned preset ratio. Furthermore, the number of bits occupied by the target identifier value and the number of bits occupied by the target length value may also be jointly determined by the receiving end and the transmitting end before the message is transmitted. That is, the receiving end knows the number of bits occupied by the target identifier value and the number of bits occupied by the target length value without being informed by the transmitting end.
[0103] Through this embodiment, the identification value and the target length value are extracted according to the number of bits occupied by the identification value and the number of bits occupied by the length value, which can improve the accuracy of obtaining the identification value and the length value.
[0104] In an exemplary embodiment, determining the target memory address according to the target identification value, the base address and the address unit size includes: determining the target memory address as the sum of the product of the target identification value and the address unit size and the base address.
[0105] In this embodiment, the target identification value can be the quotient obtained by dividing the address offset between the target memory address and the base address by the address unit size (i.e., bufferId = (BufferAddr-BaseAddr) / UnitSize). The receiving end can determine the target memory address as the product of the target identification value and the address unit size and the sum of the target identification value and the base address, that is, determine the target memory address according to the calculation formula BufferAddr = bufferId*UnitSize+BaseAddr.
[0106] Through this embodiment, the memory address is determined based on the product of the identification value and the address unit size and the sum of the base address, which can reduce the number of bits of the target memory address in the target transmission message while improving the accuracy of the target memory address transmission.
[0107] In an exemplary embodiment, after determining the target memory address based on the target identification value, base address and address unit size, the above method also includes: performing a legitimacy check on the target memory address to obtain a legitimacy check result; when the legitimacy check result indicates that the target memory address is legal, saving the target memory address and releasing the target transmission message; when the legitimacy check result indicates that the target memory address is illegal, sending message exception indication information to the sending end and releasing the target transmission message, wherein the message exception indication information is used to indicate that the memory address transmitted in the target transmission message is abnormal.
[0108] In order to improve the security of message transmission and avoid the impact on the receiving end due to situations such as illegal transmitted memory addresses, in this embodiment, after determining the target memory address, the target memory address can be checked for legitimacy and a legitimacy check result can be obtained.
[0109] If the validity check result indicates that the target memory address is valid, the target memory address can be saved and the target transmission message can be released. If the validity check result indicates that the target memory address is invalid, message abnormality indication information can be sent to the sender and the target transmission message can be released. Here, the message abnormality indication information can be used to indicate that the memory address transmitted in the target transmission message is abnormal.
[0110] For example, taking the target transmission message as an IPC message, after obtaining the BufferAddr, the receiving end can check the parameters of the BufferAddr. If it is legal, the BufferAddr is directly used and the IPC message is released, and the next step is processed. If it is illegal, an exception is returned and the IPC message is released.
[0111] Through this embodiment, by performing a validity check on a determined memory address, it is possible to avoid situations where an illegal memory address causes the transmitted message to be invalid or affects the receiving end, thereby improving the effectiveness of message transmission.
[0112] In an exemplary embodiment, a validity check is performed on the target memory address to obtain a validity check result, including: when the target memory address is within a preset address range, determining that the target memory address is legal; when the target memory address is outside the preset address range, determining that the target memory address is illegal.
[0113] The validity check of the target memory address may be to check whether the size of the target memory address is within an expected range. In this embodiment, an address range may be pre-set, ie, a preset address range, for determining whether the determined memory address is valid.
[0114] If the target memory address is within the preset address range, the target memory address can be determined to be legal, whereas if the target memory address is outside the preset address range, the target memory address can be determined to be illegal.
[0115] Through this embodiment, by presetting the address range of the memory address and checking whether the memory address is within the address range to determine whether the determined memory address is legal, the efficiency of the legality check can be improved, thereby improving the efficiency of message transmission.
[0116] The message transmission method in the embodiment of the present application is explained below with reference to an optional example. In this optional example, the target transmission message is an IPC message, the target memory address is BufferAddr (i.e., buffer address), the target transmission message is an IPC message, the base address is BaseAddr, and the address unit size is UnitSize.
[0117] Because IPC messages sometimes require multiple layers of forwarding when transmitted between different FUs, excessively long messages can consume significant bandwidth and increase command transmission time. This optional example provides a method for improving IPC message transmission efficiency. Instead of using absolute 64-bit addresses within messages, messages are transmitted using the bufferId plus bufferLength format. During transmission, the sender calculates the bufferId and bufferLength based on the defined BaseAddr and UnitSize values and the buffer address to be transmitted, and inserts them into the message body. The receiver calculates the buffer address based on the defined BaseAddr and UnitSize values and the received bufferId and bufferLength, completing the address transmission. This simple calculation significantly reduces the space occupied by the BufferAddr variable within the message. Originally, two Dwords could only transmit one 64-bit absolute address, but after optimization, four or more absolute addresses can be transmitted. This simple calculation reduces message length, optimizes data exchange between processes, improves message transmission efficiency, reduces unnecessary transmission bandwidth waste, and more efficiently utilizes bus bandwidth, ultimately improving product performance.
[0118] The message transmission method in this optional example may include the following steps:
[0119] Step 1: Define BaseAddr and UnitSize when initializing memory.
[0120] Step 2: After the sender obtains BufferAddr, it calculates the relative offset of BufferAddr relative to the base address, determines bufferId according to the formula bufferId = (BufferAddr - BaseAddr) / UnitSize, and obtains bufferLength by dividing the buffer size to be transmitted by UnitSize.
[0121] Step 3: Fill the obtained bufferId and bufferLength into the IPC message structure. The proportion of each bit can be dynamically adjusted according to the number of bits occupied.
[0122] Step 4: The receiving end receives the IPC message, extracts bufferId and bufferLength, and determines the buffer address based on the parameters defined in step 1 and the formula BufferAddr = bufferId*UnitSize+BaseAddr.
[0123] Step 5: After obtaining BufferAddr, the parameters of BufferAddr can be checked to determine whether it is within the legal range. If it is legal, BufferAddr is directly used and the IPC message is released. If it is illegal, an exception is returned and the IPC message is released.
[0124] Through this optional example, by adding simple calculations when processing bufferAddr, bufferAddr can be reconstructed. The bits occupied by each reconstructed bufferAddr are reduced, thereby reducing the length of the IPC message. Compared with the method of transmitting direct addresses, unnecessary transmission is reduced, bandwidth utilization is effectively improved, and the transmission bus is used more efficiently and fully.
[0125] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.
[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a non-volatile readable storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the method of each embodiment of the present application.
[0127] According to another aspect of the embodiments of the present application, a message transmission device is also provided, which is configured to implement the message transmission method provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0128] FIG4 is a structural block diagram of a message transmission device according to an embodiment of the present application. As shown in FIG4 , the device includes:
[0129] The first acquiring unit 402 is configured to acquire a target memory address, wherein the target memory address is a buffer address of a target buffer transmitted by a target transmission message to be transmitted;
[0130] A first determining unit 404 is configured to determine an identification value of an address identifier corresponding to a target memory address according to a base address and an address unit size, to obtain a target identification value;
[0131] The first execution unit 406 is configured to write the target identification value into the message structure of the target transmission message, and transmit the target transmission message to the receiving end of the target transmission message.
[0132] Through the embodiments of the present application, a target memory address is obtained, wherein the target memory address is the buffer address of the target buffer transmitted by the target transmission message to be transmitted; based on the base address and the address unit size, an identification value of the address identifier corresponding to the target memory address is determined to obtain a target identification value; the target identification value is written into the message structure of the target transmission message, and the target transmission message is transmitted to the receiving end of the target transmission message. This can solve the problem of low message transmission efficiency in the transmission method of inter-process communication messages in the related art due to the excessive length of the message to be transmitted, thereby improving the message transmission efficiency.
[0133] Optionally, the above device further includes:
[0134] The second acquisition unit is configured to obtain the base address and the address unit size before determining the identification value of the address identifier corresponding to the target memory address based on the base address and the address unit size, wherein the base address and the address unit size are set during the memory initialization process.
[0135] Optionally, the above device further includes:
[0136] The second execution unit is configured to set the minimum value of the buffer address as the base address and to set the minimum unit between storage addresses as the address unit size.
[0137] Optionally, the second acquiring unit includes:
[0138] The read unit is configured to read a base address and an address unit size from a preset register.
[0139] Optionally, the first determining unit includes:
[0140] A first determining module is configured to determine an address offset between a target memory address and a base address to obtain a target offset;
[0141] The second determining module is configured to determine a target identification value of an address identification corresponding to a target memory address according to a target offset and an address unit size.
[0142] Optionally, the second determining module includes:
[0143] The determination submodule is configured to determine a quotient obtained by dividing the target offset by the address unit size as a target identification value of an address identification corresponding to the target memory address.
[0144] Optionally, the above device further includes a second determining unit, and the first executing unit includes a writing module, wherein:
[0145] A second determining unit is configured to determine a parameter value of a buffer length parameter corresponding to the target memory address according to a buffer size and an address unit size of the target buffer, to obtain a target length value;
[0146] The writing module is configured to write the target identification value and the target length value into the message structure of the target transmission message.
[0147] Optionally, the second determining unit includes:
[0148] The third determining module is configured to determine a quotient obtained by dividing the buffer size of the target buffer by the address unit size as a target length value of a buffer length parameter corresponding to the target memory address.
[0149] Optionally, the writing module includes:
[0150] The writing submodule is configured to write the target identification value and the target length value into the message structure of the target transmission message according to the number of bits occupied by the target identification value and the number of bits occupied by the target length value.
[0151] Optionally, the above device further includes:
[0152] The adjustment unit is configured to dynamically adjust the number of bits occupied by the target identification value and the number of bits occupied by the target length value according to the number of bits occupied by the target memory address.
[0153] Optionally, the adjustment unit includes:
[0154] The fourth determination module is configured to determine the product of the number of bits occupied by the target memory address and a preset ratio as the number of bits occupied by the target identification value, and to determine the difference between the number of bits occupied by the target memory address and the number of bits occupied by the target identification value as the number of bits occupied by the target length value.
[0155] Optionally, the first determining unit includes:
[0156] The fifth determination module is configured to determine the identification value of the address identifier corresponding to each memory address in the multiple memory addresses according to the base address and the address unit size when the target memory address contains multiple memory addresses, and obtain the identification value corresponding to each memory address, wherein the target identification value includes the identification value corresponding to each memory address.
[0157] Optionally, the first acquiring unit includes:
[0158] The acquisition module is set to obtain the absolute address of the target buffer and obtain the target memory address.
[0159] According to another aspect of the embodiments of the present application, a message transmission device is provided. The device is configured to implement the message transmission method provided in the above embodiments. Details already described are omitted. FIG5 is a block diagram of another message transmission device according to an embodiment of the present application. As shown in FIG5 , the device includes:
[0160] The receiving unit 502 is configured to receive a target transmission message sent by a sending end;
[0161] The extraction unit 504 is configured to extract a target identification value from a message structure of the target transmission message, wherein the target identification value is an identification value of an address identifier corresponding to a target memory address;
[0162] The third determining unit 506 is configured to determine the target memory address according to the target identification value, the base address and the address unit size.
[0163] Through the embodiments of the present application, a target transmission message sent by a sending end is received; a target identification value is extracted from a message structure of the target transmission message, wherein the target identification value is an identification value of an address identification corresponding to a target memory address; and the target memory address is determined based on the target identification value, the base address, and the address unit size. This can solve the problem of low message transmission efficiency due to excessive length of the message to be transmitted in the transmission method of inter-process communication messages in related technologies, thereby improving message transmission efficiency.
[0164] Optionally, the extraction unit includes:
[0165] a sixth determining module configured to determine the number of bits occupied by the target identification value and the number of bits occupied by the target length value, wherein the target length value is a parameter value of a buffer length parameter corresponding to the target memory address, and the target length value is used to identify a buffer size of the target buffer corresponding to the target memory address;
[0166] The extraction module is configured to extract the target identification value and the target length value from the message structure of the target transmission message according to the number of bits occupied by the target identification value and the number of bits occupied by the target length value.
[0167] Optionally, the third determining unit includes:
[0168] The seventh determination module is configured to determine the sum of the product of the target identification value and the address unit size and the base address as the target memory address.
[0169] Optionally, the above device further includes:
[0170] The checking unit is configured to perform a validity check on the target memory address after determining the target memory address according to the target identification value, the base address and the address unit size, and obtain a validity check result;
[0171] a third execution unit configured to save the target memory address and release the target transmission message if the legitimacy check result indicates that the target memory address is legal;
[0172] The fourth execution unit is configured to send message exception indication information to the sending end and release the target transmission message when the validity check result indicates that the target memory address is illegal, wherein the message exception indication information is used to indicate that the memory address transmitted in the target transmission message is abnormal.
[0173] Optionally, the inspection unit includes:
[0174] an eighth determining module, configured to determine that the target memory address is legal if the target memory address is within a preset address range;
[0175] The ninth determining module is configured to determine that the target memory address is illegal when the target memory address is outside a preset address range.
[0176] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0177] According to another aspect of the embodiments of the present application, a non-volatile readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any of the above method embodiments when running.
[0178] In an exemplary embodiment, the non-volatile readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0179] According to another aspect of the embodiments of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.
[0180] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0181] The examples in this embodiment can refer to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail here.
[0182] Obviously, those skilled in the art should understand that the various modules or steps of the above-mentioned embodiments of the present application can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented using program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be performed in a different order than herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0183] The above are merely optional embodiments of the present application and are not intended to limit the embodiments of the present application. For those skilled in the art, the embodiments of the present application may be modified and varied in various ways. Any modifications, equivalent replacements, improvements, etc. made within the principles of the embodiments of the present application shall be included in the scope of protection of the embodiments of the present application.
Claims
1. A method for transmitting a message, It is characterized in that include: Obtaining a target memory address, wherein the target memory address is a buffer address of a target buffer transmitted by a target transmission message to be transmitted; Determine the identification value of the address identification corresponding to the target memory address according to the base address and the address unit size, and obtain the target identification value; The target identification value is written into the message structure of the target transmission message, and the target transmission message is transmitted to the receiving end of the target transmission message.
2. The method according to claim 1, It is characterized in that Before determining the identification value of the address identifier corresponding to the target memory address according to the base address and the address unit size, the method further includes: The base address and the address unit size are obtained, wherein the base address and the address unit size are set during memory initialization.
3. The method according to claim 2, It is characterized in that The method further comprises: The minimum value of the buffer address is set as the base address, and the minimum unit of the storage address element is set as the address unit size.
4. The method according to claim 2, It is characterized in that The obtaining of the base address and the address unit size comprises: The base address and the address unit size are read from a preset register.
5. The method according to claim 1, It is characterized in that The step of determining the identification value of the address identification corresponding to the target memory address according to the base address and the address unit size to obtain the target identification value includes: Determine the address offset between the target memory address and the base address to obtain a target offset; The target identifier value of the address identifier corresponding to the target memory address is determined according to the target offset and the address unit size.
6. The method according to claim 5, It is characterized in that Determining the target identifier value of the address identifier corresponding to the target memory address according to the target offset and the address unit size includes: A quotient obtained by dividing the target offset by the address unit size is determined as the target identifier value of the address identifier corresponding to the target memory address.
7. The method according to claim 1, It is characterized in that The method further comprises: determining a parameter value of a buffer length parameter corresponding to the target memory address according to the buffer size of the target buffer and the address unit size, to obtain a target length value; The step of writing the target identification value into the message structure of the target transmission message includes: writing the target identification value and the target length value into the message structure of the target transmission message.
8. The method according to claim 7, It is characterized in that The step of determining a parameter value of a buffer length parameter corresponding to the target memory address according to the buffer size of the target buffer and the address unit size to obtain a target length value includes: A quotient obtained by dividing the buffer size of the target buffer by the address unit size is determined as the target length value of the buffer length parameter corresponding to the target memory address.
9. The method according to claim 7, It is characterized in that The step of writing the target identification value and the target length value into the message structure of the target transmission message comprises: According to the number of bits occupied by the target identification value and the number of bits occupied by the target length value, the target identification value and the target length value are written into the message structure of the target transmission message.
10. The method according to claim 9, It is characterized in that The method further comprises: The number of bits occupied by the target identification value and the number of bits occupied by the target length value are dynamically adjusted according to the number of bits occupied by the target memory address.
11. The method according to claim 10, It is characterized in that The dynamically adjusting the number of bits occupied by the target identification value and the number of bits occupied by the target length value according to the number of bits occupied by the target memory address includes: The product of the number of bits occupied by the target memory address and the preset ratio is determined as the number of bits occupied by the target identification value, and the difference between the number of bits occupied by the target memory address and the number of bits occupied by the target identification value is determined as the number of bits occupied by the target length value.
12. The method according to claim 1, It is characterized in that The step of determining the identification value of the address identification corresponding to the target memory address according to the base address and the address unit size to obtain the target identification value includes: In the case where the target memory address contains multiple memory addresses, the identification value of the address identifier corresponding to each memory address in the multiple memory addresses is determined respectively according to the base address and the address unit size, and the identification value corresponding to each memory address is obtained, wherein the target identification value includes the identification value corresponding to each memory address.
13. The method according to any one of claims 1 to 12, It is characterized in that The obtaining of the target memory address comprises: The absolute address of the target buffer is obtained to obtain the target memory address.
14. A method for transmitting a message, It is characterized in that include: Receive the target transmission message sent by the sender; Extracting a target identification value from a message structure of the target transmission message, wherein the target identification value is an identification value of an address identification corresponding to a target memory address; The target memory address is determined according to the target identification value, the base address and the address unit size.
15. The method according to claim 14, It is characterized in that The step of extracting the target identification value from the message structure of the target transmission message includes: Determine the number of bits occupied by the target identification value and the number of bits occupied by the target length value, wherein the target length value is a parameter value of a buffer length parameter corresponding to the target memory address, and the target length value is used to identify a buffer size of a target buffer corresponding to the target memory address; The target identification value and the target length value are extracted from the message structure of the target transmission message according to the number of bits occupied by the target identification value and the number of bits occupied by the target length value.
16. The method according to claim 14, It is characterized in that Determining the target memory address according to the target identification value, the base address and the address unit size includes: The product of the target identification value and the address unit size and the sum of the base address are determined as the target memory address.
17. The method according to claim 14, It is characterized in that After determining the target memory address according to the target identification value, the base address and the address unit size, the method further includes: Performing a validity check on the target memory address to obtain a validity check result; If the legality check result indicates that the target memory address is legal, save the target memory address and release the target transmission message; When the legality check result indicates that the target memory address is illegal, message exception indication information is sent to the sending end and the target transmission message is released, wherein the message exception indication information is used to indicate that the memory address transmitted in the target transmission message is abnormal.
18. The method according to claim 17, It is characterized in that The performing a validity check on the target memory address to obtain a validity check result includes: In the case where the target memory address is within a preset address range, determining that the target memory address is legal; In a case where the target memory address is outside a preset address range, it is determined that the target memory address is illegal.
19. A message transmission device, It is characterized in that include: A first acquisition unit is configured to acquire a target memory address, wherein the target memory address is a buffer address of a target buffer transmitted by a target transmission message to be transmitted; The first determining unit is configured to determine the address identifier corresponding to the target memory address according to the base address and the address unit size. Identification value, get the target identification value; The first execution unit is configured to write the target identification value into the message structure of the target transmission message, and transmit the target transmission message to a receiving end of the target transmission message.
20. A message transmission device, It is characterized in that include: A receiving unit, configured to receive a target transmission message sent by a sending end; An extraction unit is configured to extract a target identification value from a message structure of the target transmission message, wherein the target identification value is an identification value of an address identification corresponding to a target memory address; The third determination unit is configured to determine the target memory address according to the target identification value, the base address and the address unit size.
21. A non-volatile readable storage medium, It is characterized in that The non-volatile readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 18 when executed by a processor.
22. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method described in any one of claims 1 to 18 are implemented.
Citation Information
Patent Citations
Memory management method, device and equipment and computer readable storage medium
CN112214329A
Method and system for tracking target variable in executable program
CN113672499A
Inter-process communication method and inter-process communication device
CN113760560A
Data processing method, device and system
CN115269642A
Message transmission method and device, storage medium and electronic device
CN115878351A
