Communication method, device, equipment, medium and vehicle

By adding the address parameters of the IPC buffer in the objective function and creating thread information of child threads, the portability and stability problems in inter-thread communication in the existing technology are solved, and higher system stability and simplified operation processes are achieved.

CN119917309APending Publication Date: 2025-05-02BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311430423.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-31
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

When the prior art realizes inter-process communication between threads, it is necessary to modify the source code of the function library, resulting in portability problems and poor system stability.

Method used

By adding the address parameters of the IPC buffer to the target function, and in response to the instruction to create the child thread of the target process, the thread information of the child thread, including the actual address of the IPC buffer and the local storage area, realizing IPC communication between threads.

Benefits of technology

It avoids the need to modify the code, solves the portability problem, improves the stability of the system, and simplifies the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917309A_ABST
    Figure CN119917309A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a communication method and device, equipment, a medium and a vehicle, and the method comprises the steps: responding to a creation instruction of creating a sub-thread in a target process, creating thread information of the sub-thread, the thread information comprises an actual address of an inter-process communication IPC buffer region corresponding to the sub-thread, and a local storage region corresponding to the sub-thread, the local storage area comprises an initial address of the IPC buffer area; in response to an assignment instruction for a target function, the target function comprises an address parameter of the IPC buffer area, and the address parameter of the IPC buffer area is assigned as an initial address of the IPC buffer area; and in response to a calling instruction of the target function, transferring the actual address of the IPC buffer area to a local storage area corresponding to the sub-thread, so that the sub-thread updates the initial address of the IPC buffer area into the actual address of the IPC buffer area, and the sub-thread realizes IPC communication between the threads based on the actual address of the IPC buffer area. According to the embodiment of the invention, the stability of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and in particular, relates to a communication method, device, equipment, medium and vehicle. Background Art

[0002] In the prior art, in order to realize inter-process communication (IPC) between threads, it is necessary to set the corresponding IPC buffer address in the thread local storage (TLS) of each thread. However, in order to set the corresponding IPC buffer address in the TLS data of each thread, in the prior art, generally, during the process of starting the process, the IPC buffer address corresponding to each thread is stored in a register such as an FP register that can have any value at the entrance of the child thread, and the child thread entrance function in the function library is modified to set the value of the FP register to the TLS data. However, since this method requires modifying the source code in the function library, it leads to portability problems, resulting in poor stability of the system. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a communication method, device, equipment, medium and vehicle to improve the stability of the system.

[0004] In a first aspect, an embodiment of the present application provides a communication method, the method comprising:

[0005] In response to a creation instruction of a target process to create a child thread, thread information of the child thread is created, the thread information including an actual address of an inter-process communication (IPC) buffer corresponding to the child thread and a local storage area corresponding to the child thread, the local storage area including an initial address of the IPC buffer;

[0006] In response to an assignment instruction to a target function, the target function includes an address parameter of an IPC buffer, assigning the address parameter of the IPC buffer to an initial address of the IPC buffer;

[0007] In response to the calling instruction of the target function, the actual address of the IPC buffer is passed to the local storage area corresponding to the child thread, so that the child thread updates the initial address of the IPC buffer to the actual address of the IPC buffer, and implements IPC communication between threads based on the actual address of the IPC buffer.

[0008] In an optional implementation of the first aspect, the target function further includes a thread entry function;

[0009] Before calling the target function and passing the actual address of the IPC buffer to the local storage area corresponding to the child thread, the method further includes:

[0010] Store the actual addresses of the thread entry function and the IPC buffer in different general registers respectively;

[0011] In response to the call instruction of the target function, the actual address of the IPC buffer is transferred to the local storage area corresponding to the child thread, including:

[0012] In response to a call instruction to a thread entry function, a function input variable corresponding to the thread entry function is obtained, and the function input variable is assigned a target value to obtain a thread entry value;

[0013] Based on the thread entry value, the actual address of the IPC buffer is passed to the local storage area corresponding to the child thread.

[0014] In an optional implementation of the first aspect, based on the thread entry value, transferring the actual address of the IPC buffer to the local storage area corresponding to the child thread includes:

[0015] Based on the correspondence between the preset thread entry and the thread entry value, the thread entry value is matched to determine the target thread entry corresponding to the thread entry value;

[0016] Based on the target thread entry, the actual address of the IPC buffer is passed to the local storage area corresponding to the child thread.

[0017] In an optional implementation of the first aspect, before assigning the address parameter of the IPC buffer to the initial address of the IPC buffer in response to the assignment instruction to the target function, the method further includes:

[0018] Get the thread entry function and the address parameters of the IPC buffer area;

[0019] Encapsulate the thread entry function and the address parameters of the IPC cache to build the target function.

[0020] In a second aspect, an embodiment of the present application provides a communication device, the device comprising:

[0021] A creation module, configured to respond to a creation instruction of a target process to create a child thread, create thread information of the child thread, the thread information including an actual address of an inter-process communication IPC buffer corresponding to the child thread, and a local storage area corresponding to the child thread, the local storage area including an initial address of the IPC buffer;

[0022] An assignment module, for responding to an assignment instruction to a target function, wherein the target function includes an address parameter of an IPC buffer, and assigning the address parameter of the IPC buffer to an initial address of the IPC buffer;

[0023] The transfer module is used to respond to the call instruction of the target function and transfer the actual address of the IPC buffer to the local storage area corresponding to the child thread, so that the child thread updates the initial address of the IPC buffer to the actual address of the IPC buffer, and realizes IPC communication between threads based on the actual address of the IPC buffer.

[0024] In an optional implementation of the second aspect, the target function further includes a thread entry function; and the communication device further includes:

[0025] A storage module, used for storing the thread entry function and the actual address of the IPC buffer into different general registers before calling the target function and passing the actual address of the IPC buffer to the local storage area corresponding to the child thread;

[0026] An assignment module, for obtaining a function input variable corresponding to the thread entry function in response to a call instruction to the thread entry function, and assigning the function input variable to a target value to obtain a thread entry value;

[0027] The transfer module is used to transfer the actual address of the IPC buffer to the local storage area corresponding to the child thread based on the thread entry value.

[0028] In an optional implementation of the second aspect, the communication device further includes:

[0029] A matching module, used to match the thread entry value based on the correspondence between the preset thread entry and the thread entry value, and determine the target thread entry corresponding to the thread entry value;

[0030] The transfer module is used to transfer the actual address of the IPC buffer to the local storage area corresponding to the child thread based on the target thread entry.

[0031] In a third aspect, an electronic device is provided, comprising a memory for storing computer program instructions; and a processor for reading and running the computer program instructions stored in the memory to execute the communication method provided in any optional implementation manner in the first aspect.

[0032] In a fourth aspect, a computer storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the communication method provided by any optional implementation in the first aspect is implemented.

[0033] In a fifth aspect, a vehicle is provided, comprising at least one of the above-mentioned communication device, electronic device and computer storage medium.

[0034] In an embodiment of the present application, it is possible to create thread information of a child thread in response to a creation instruction of a target process to create a child thread. Since the thread information includes the actual address of the inter-process communication IPC buffer corresponding to the child thread, and the local storage area corresponding to the child thread, and the local storage area includes the initial address of the IPC buffer, based on this, in response to an assignment instruction to a target function, the address parameter of the IPC buffer in the target function is assigned to the initial address of the IPC buffer, and then in response to a call instruction of the target function, the actual address of the IPC buffer can be directly passed to the local storage area corresponding to the child thread, so that the child thread can update the initial address of the IPC buffer to the actual address of the IPC buffer, and realize IPC communication between threads based on the actual address of the IPC buffer. In this way, since the target function in the embodiment of the present application adds the address parameter of the IPC buffer compared to the thread entry function in the prior art, the address parameter of the IPC buffer can be assigned a value so that in the process of actually calling the target function, the actual address of the IPC buffer can be directly passed to the local storage area corresponding to the child thread, thereby avoiding the need to modify the code in the prior art, that is, avoiding portability issues, thereby improving the stability of the system and simplifying the system's operating procedures. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0036] Figure 1 It is a flow chart of a communication method provided in an embodiment of the present application;

[0037] Figure 2 is a structural diagram of a communication device provided in an embodiment of the present application;

[0038] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0040] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0041] In order to solve the problem of poor system stability existing in the prior art, the embodiments of the present application provide a communication method, apparatus, device, medium and vehicle to create thread information of a child thread. Since the thread information includes the actual address of the inter-process communication IPC buffer corresponding to the child thread and the local storage area corresponding to the child thread, and the local storage area includes the initial address of the IPC buffer, based on this, in response to the assignment instruction of the target function, the address parameter of the IPC buffer in the target function is assigned to the initial address of the IPC buffer, and then in response to the call instruction of the target function, the actual address of the IPC buffer can be directly passed to the local storage area corresponding to the child thread, so that the child thread can update the initial address of the IPC buffer to the actual address of the IPC buffer, and realize IPC communication between threads based on the actual address of the IPC buffer. In this way, since the target function in the embodiment of the present application adds the address parameter of the IPC buffer compared to the thread entry function in the prior art, the address parameter of the IPC buffer can be assigned a value so that in the process of actually calling the target function, the actual address of the IPC buffer can be directly passed to the local storage area corresponding to the child thread, thereby avoiding the need to modify the code in the prior art, that is, avoiding portability issues, thereby improving the stability of the system and simplifying the system's operating procedures.

[0042] The communication method provided in the embodiment of the present application can be executed by a communication device or a control module in the communication device for executing the communication method. The communication method provided in the embodiment of the present application is described in detail by taking the communication device executing the communication method as an example.

[0043] The communication method provided in the embodiment of the present application is described in detail below through specific embodiments in conjunction with the accompanying drawings.

[0044] Figure 1 It is a flow chart of a communication method provided in an embodiment of the present application.

[0045] like Figure 1 As shown, the execution subject of the communication method may be a communication device, and the method may include the following steps:

[0046] S110, in response to a creation instruction of a target process to create a child thread, thread information of the child thread is created.

[0047] Specifically, the communication device may receive a creation instruction of a target process to create a child thread, and in response to the creation instruction, create thread information of the child thread. In some embodiments, the thread information involved may include the actual address of the inter-process communication IPC buffer corresponding to the child thread, and the local storage area corresponding to the child thread, and the local storage area may include the initial address of the IPC buffer. The local storage area is a TLS data area.

[0048] It should be noted that the above-mentioned target process can be created in response to the startup input of the target program, wherein the target program can be a system service program, such as a root server (RS), a virtual file system (VFS), etc., or it can be an application program, which is not specifically limited here.

[0049] It should also be noted that the TLS data area involved above is for each thread, that is, the TLS data of each thread exists independently and does not interfere with each other. At the same time, within each thread, the same symbol can be used to access and use the respective TLS data. It should also be noted that the TLS data corresponding to each thread is obtained from the executable and linkable file format (ELF) file of the corresponding process, which is not specifically limited here. In addition, the TLS data area involved above is used to save the IPC buffer address, for example, using the __ipc_buffer variable (stored in the TLS data area, modified by the keyword __thread). In this way, it is possible to use the same variable name to obtain the IPC buffer associated with the calling thread within different threads, and there will be no conflict with the IPCBuffer used in other threads. In addition, since the IPC Buffer address used in each thread is different, it is necessary to write the corresponding IPC Buffer address into the __ipc_buffer variable before the thread uses the IPC Buffer.

[0050] S120, in response to the assignment instruction to the target function, assigning the address parameter of the IPC buffer to the initial address of the IPC buffer.

[0051] In some embodiments, the above-mentioned target function includes an address parameter of an IPC buffer.

[0052] Specifically, since the target function may include an address parameter of the IPC buffer, the communication device may respond to an assignment instruction to the target function to assign the address parameter of the IPC buffer of the target function to the initial address of the IPC buffer.

[0053] In one example, assuming that the address parameter of the IPC buffer included in the target function is ipcbuf, based on this, the communication device can use an assignment instruction, for example, ipcbufaddr=ipcbuff, where ipcbufaddr is the initial address of the IPC buffer stored in the local storage area of ​​the child thread.

[0054] S130, in response to the calling instruction of the target function, the actual address of the IPC buffer is passed to the local storage area corresponding to the child thread, so that the child thread updates the initial address of the IPC buffer to the actual address of the IPC buffer, and implements IPC communication between threads based on the actual address of the IPC buffer.

[0055] Specifically, the communication device can receive a call instruction to the target function, and in response to the call instruction to the target function, pass the actual address of the IPC buffer area to the local storage area corresponding to the child thread. In this way, the child thread can update the initial address of the IPC buffer originally stored in the local storage area to the actual IPC address, and then realize IPC communication between threads based on the actual address of the IPC buffer.

[0056] In an embodiment of the present application, it is possible to create thread information of a child thread in response to a creation instruction of a target process to create a child thread. Since the thread information includes the actual address of the inter-process communication IPC buffer corresponding to the child thread, and the local storage area corresponding to the child thread, and the local storage area includes the initial address of the IPC buffer, based on this, in response to an assignment instruction to a target function, the address parameter of the IPC buffer in the target function is assigned to the initial address of the IPC buffer, and then in response to a call instruction of the target function, the actual address of the IPC buffer can be directly passed to the local storage area corresponding to the child thread, so that the child thread can update the initial address of the IPC buffer to the actual address of the IPC buffer, and realize IPC communication between threads based on the actual address of the IPC buffer. In this way, since the target function in the embodiment of the present application adds the address parameter of the IPC buffer compared to the thread entry function in the prior art, the address parameter of the IPC buffer can be assigned a value so that in the process of actually calling the target function, the actual address of the IPC buffer can be directly passed to the local storage area corresponding to the child thread, thereby avoiding the need to modify the code in the prior art, that is, avoiding portability issues, thereby improving the stability of the system and simplifying the system's operating procedures.

[0057] Considering the compatibility issues that may be caused by using FP registers in the prior art, that is, when FP registers are reused, the created child threads may not be able to run normally, thereby resulting in low robustness of the system. Based on this, in some embodiments, the target function involved above may also include a thread entry function. Based on this, in one embodiment, before calling the target function and passing the actual address of the IPC buffer to the local storage area corresponding to the child thread, the communication method involved above may also include the following steps:

[0058] The actual addresses of the thread entry function and the IPC buffer are stored in different general registers respectively.

[0059] Specifically, after obtaining the actual addresses of the thread entry function and the IPC buffer, the communication device can store the obtained thread entry function and the actual addresses of the IPC buffer in different general registers. In one example, the communication device can store the obtained thread entry function in the general register x0 and store the obtained actual address of the IPC buffer in the general register x1.

[0060] In another example, since the thread entry function may include function input variables, based on this, the communication device may store the acquired thread entry function in the general register x0, store the function input variables in the general register x1, and store the actual address of the IPC buffer acquired above in x2.

[0061] Based on this, the above-mentioned step of transmitting the actual address of the IPC buffer to the local storage area corresponding to the child thread in response to the call instruction of the target function may specifically include the following steps:

[0062] In response to a call instruction to a thread entry function, a function input variable corresponding to the thread entry function is obtained, and the function input variable is assigned a target value to obtain a thread entry value;

[0063] Based on the thread entry value, the actual address of the IPC buffer is passed to the local storage area corresponding to the child thread.

[0064] Specifically, the communication device can obtain the function input variable corresponding to the thread entry function in response to the call instruction of the thread entry function, and assign the function input variable to the target value to obtain the thread entry value, that is, by inputting the target value as the function input variable corresponding to the above-mentioned thread entry function into the thread entry function to obtain the thread entry value. Based on this, the communication device can transfer the actual address of the IPC buffer stored in the general register to the local storage area corresponding to the child thread based on the thread entry value, so that the child thread can update the initial address of the IPC buffer to the actual address of the IPC buffer, so that the child thread can realize IPC communication between threads based on the actual address of the IPC buffer.

[0065] In this embodiment, the thread entry function and the actual address of the IPC buffer can be stored in a general register, and then in response to a call instruction to the thread entry function, the function input variable corresponding to the thread entry function is obtained, and the function input variable is assigned to a target value to obtain a thread entry value, and then the actual address of the IPC buffer can be passed to the child thread based on the thread entry value. In this way, the compatibility problem that may be caused by using FP registers in the prior art can be avoided, and the stability of the system is improved.

[0066] In order to more accurately describe the communication method provided by the embodiment of the present application, in one embodiment, the above-mentioned step of transferring the actual address of the IPC buffer to the local storage area corresponding to the child thread based on the thread entry value may also include the following steps:

[0067] Based on the correspondence between the preset thread entry and the thread entry value, the thread entry value is matched to determine the target thread entry corresponding to the thread entry value;

[0068] Based on the target thread entry, the actual address of the IPC buffer stored in the general register is transferred to the local storage area corresponding to the child thread.

[0069] The correspondence between the preset thread entry and the thread entry value may be preset based on actual experience or circumstances, and is not further limited herein.

[0070] Specifically, the communication device can match the thread entry value based on the correspondence between the preset thread entry and the thread entry value to determine the target thread entry corresponding to the thread entry value, and then based on the target thread entry, the actual address of the IPC buffer stored in the general register can be passed to the local storage area corresponding to the child thread.

[0071] In this embodiment, the thread entry value can be matched based on the correspondence between the pre-set thread entry and the thread entry value to determine the target thread entry of the child thread, and then the actual address of the IPC buffer stored in the general register can be passed to the local storage area corresponding to the child thread. In this way, it can be ensured that the child thread created by the target process can run normally.

[0072] In order to more accurately and comprehensively describe the communication method provided by the embodiment of the present application, in one embodiment, before assigning the address parameter of the IPC buffer to the initial address of the IPC buffer in response to the assignment instruction of the target function, the communication method involved above may include:

[0073] Get the thread entry function and the address parameters of the IPC buffer area;

[0074] Encapsulate the thread entry function and the address parameters of the IPC cache to build the target function.

[0075] Specifically, the communication device can obtain the address parameters of the thread entry function and the IPC buffer area, and then encapsulate the thread entry function and the address parameters of the IPC buffer area to construct a target function. It should be noted that the thread entry function involved above and the function input variables corresponding to the thread entry function can be obtained from a function library.

[0076] In an example, the objective function involved above can be expressed as the following formula (1):

[0077] Int(*)(int(*fn)(void*),void*arg,unsigned long ipcbuf)(1)

[0078] Among them, fn is the child thread entry function, arg is the function input variable corresponding to the child thread entry function, and ipcbuf is the address parameter of the child thread IPC buffer area.

[0079] In this embodiment, since the target function defined in the embodiment of the present application adds the address parameter of the IPC buffer compared to the thread entry function in the prior art, it is convenient to subsequently assign values ​​to the address parameters of the IPC buffer, and then in the process of actually calling the target function, the actual address of the IPC buffer can be directly passed to the local storage area corresponding to the child thread.

[0080] Based on the same inventive concept, the present application embodiment also provides a communication device, which can be specifically combined with Figure 2 The communication device provided in the embodiment of the present application is described in detail.

[0081] Figure 2It is a structural diagram of a communication device provided in an embodiment of the present application.

[0082] like Figure 2 As shown, the communication device 200 may include: a creation module 210 , an assignment module 22 and a transmission module 230 .

[0083] A creation module 210, configured to create thread information of the child thread in response to a creation instruction of the target process to create a child thread, wherein the thread information includes an actual address of an inter-process communication IPC buffer corresponding to the child thread, and a local storage area corresponding to the child thread, wherein the local storage area includes an initial address of the IPC buffer;

[0084] An assignment module 220, for responding to an assignment instruction to a target function, the target function including an address parameter of an IPC buffer, and assigning the address parameter of the IPC buffer to an initial address of the IPC buffer;

[0085] The transfer module 230 is used to respond to the calling instruction of the target function and transfer the actual address of the IPC buffer to the local storage area corresponding to the child thread, so that the child thread updates the initial address of the IPC buffer to the actual address of the IPC buffer, and the child thread realizes IPC communication between threads based on the actual address of the IPC buffer.

[0086] In one embodiment, the target function further includes a thread entry function; and the communication device further includes:

[0087] A storage module, used for storing the thread entry function and the actual address of the IPC buffer into different general registers before calling the target function and passing the actual address of the IPC buffer to the local storage area corresponding to the child thread;

[0088] An assignment module, for obtaining a function input variable corresponding to the thread entry function in response to a call instruction to the thread entry function, and assigning the function input variable to a target value to obtain a thread entry value;

[0089] The transfer module is used to transfer the actual address of the IPC buffer to the local storage area corresponding to the child thread based on the thread entry value.

[0090] In one embodiment, the communication device further comprises:

[0091] A matching module, used to match the thread entry value based on the correspondence between the preset thread entry and the thread entry value, and determine the target thread entry corresponding to the thread entry value;

[0092] The transfer module is used to transfer the actual address of the IPC buffer to the local storage area corresponding to the child thread based on the target thread entry.

[0093] In one embodiment, the apparatus further comprises:

[0094] An acquisition module, used for acquiring address parameters of a thread entry function and an IPC buffer area before assigning the address parameter of the IPC buffer area to an initial address of the IPC buffer area in response to an assignment instruction to a target function;

[0095] The construction module is used to construct the target function by encapsulating the thread entry function and the address parameters of the IPC cache.

[0096] In an embodiment of the present application, it is possible to create thread information of a child thread in response to a creation instruction of a target process to create a child thread. Since the thread information includes the actual address of the inter-process communication IPC buffer corresponding to the child thread, and the local storage area corresponding to the child thread, and the local storage area includes the initial address of the IPC buffer, based on this, in response to an assignment instruction to a target function, the address parameter of the IPC buffer in the target function is assigned to the initial address of the IPC buffer, and then in response to a call instruction of the target function, the actual address of the IPC buffer can be directly passed to the local storage area corresponding to the child thread, so that the child thread can update the initial address of the IPC buffer to the actual address of the IPC buffer, and realize IPC communication between threads based on the actual address of the IPC buffer. In this way, since the target function in the embodiment of the present application adds the address parameter of the IPC buffer compared to the thread entry function in the prior art, the address parameter of the IPC buffer can be assigned a value so that in the process of actually calling the target function, the actual address of the IPC buffer can be directly passed to the local storage area corresponding to the child thread, thereby avoiding the need to modify the code in the prior art, that is, avoiding portability issues, thereby improving the stability of the system and simplifying the system's operating procedures.

[0097] Each module in the communication device provided in the embodiment of the present application can be used to implement Figure 1 The method steps of the illustrated embodiment can achieve the corresponding technical effects, and for the sake of brevity, they will not be repeated here.

[0098] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0099] The electronic device may include a processor 301 and a memory 302 storing computer program instructions.

[0100] Specifically, the processor 301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0101] The memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 302 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 302 is a non-volatile solid-state memory.

[0102] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.

[0103] The processor 301 implements any one of the communication methods in the above embodiments by reading and executing computer program instructions stored in the memory 302 .

[0104] In one example, the electronic device may further include a communication interface 303 and a bus 310. Figure 3 As shown, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 and communicate with each other.

[0105] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0106] Bus 310 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 310 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0107] In addition, in combination with the communication method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the communication method provided in the embodiment of the present application is implemented.

[0108] An embodiment of the present application also provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes a communication method as provided in the embodiment of the present application.

[0109] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0110] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0111] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0112] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable communication device to produce a machine so that these instructions executed by the processor of the computer or other programmable communication device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0113] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

[0114] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A communication method, characterized in that: The method comprises: In response to a creation instruction of a target process to create a child thread, thread information of the child thread is created, the thread information including an actual address of an inter-process communication (IPC) buffer corresponding to the child thread and a local storage area corresponding to the child thread, the local storage area including an initial address of the IPC buffer; In response to an assignment instruction to a target function, the target function includes an address parameter of an IPC buffer, assigning the address parameter of the IPC buffer to an initial address of the IPC buffer; In response to the calling instruction of the target function, the actual address of the IPC buffer is passed to the local storage area corresponding to the child thread, so that the child thread updates the initial address of the IPC buffer to the actual address of the IPC buffer, and implements IPC communication between threads based on the actual address of the IPC buffer.

2. The method according to claim 1, characterized in that The target function also includes a thread entry function; Before calling the target function and transferring the actual address of the IPC buffer to the local storage area corresponding to the child thread, the method further includes: The thread entry function and the actual address of the IPC buffer are stored in different general registers respectively; The step of transmitting the actual address of the IPC buffer to the local storage area corresponding to the child thread in response to the call instruction of the target function includes: In response to a call instruction to the thread entry function, a function input variable corresponding to the thread entry function is acquired, and the function input variable is assigned a target value to obtain a thread entry value; Based on the thread entry value, the actual address of the IPC buffer is transferred to the local storage area corresponding to the child thread.

3. The method according to claim 2, characterized in that The transferring the actual address of the IPC buffer to the local storage area corresponding to the child thread based on the thread entry value includes: Based on the correspondence between the preset thread entry and the thread entry value, the thread entry value is matched to determine the target thread entry corresponding to the thread entry value; Based on the target thread entry, the actual address of the IPC buffer stored in the general register is transferred to the local storage area corresponding to the child thread.

4. The method according to claim 1, characterized in that: Before assigning the address parameter of the IPC buffer to the initial address of the IPC buffer in response to the assignment instruction to the target function, the method further includes: Get the thread entry function and the address parameters of the IPC buffer area; The thread entry function and the address parameters of the IPC cache are encapsulated to construct a target function.

5. A communication device, characterized in that: The device comprises: A creation module, configured to create thread information of a child thread in response to a creation instruction of a target process to create a child thread, wherein the thread information includes an actual address of an inter-process communication (IPC) buffer corresponding to the child thread and a local storage area corresponding to the child thread, wherein the local storage area includes an initial address of the IPC buffer; An assignment module, configured to respond to an assignment instruction to a target function, wherein the target function includes an address parameter of an IPC buffer, and assign the address parameter of the IPC buffer to an initial address of the IPC buffer; A transfer module is used to transfer the actual address of the IPC buffer to the local storage area corresponding to the child thread in response to the calling instruction of the target function, so that the child thread updates the initial address of the IPC buffer to the actual address of the IPC buffer, and realizes IPC communication between threads based on the actual address of the IPC buffer.

6. The device according to claim 5, characterized in that The target function also includes a thread entry function; the communication device also includes: A storage module, used for storing the thread entry function and the actual address of the IPC buffer in different general registers before respectively passing the actual address of the IPC buffer to the local storage area corresponding to the child thread when calling the target function; The assignment module is used to obtain a function input variable corresponding to the thread entry function in response to a call instruction to the thread entry function, and assign the function input variable to a target value to obtain a thread entry value; The transfer module is used to transfer the actual address of the IPC buffer stored in the general register to the local storage area corresponding to the child thread based on the thread entry value.

7. The method according to claim 6, characterized in that The communication device further comprises: A matching module, configured to match the thread entry value based on a preset correspondence between the thread entry and the thread entry value, and determine a target thread entry corresponding to the thread entry value; The transfer module is used to transfer the actual address of the IPC buffer to the local storage area corresponding to the child thread based on the target thread entry.

8. An electronic device, characterized in that: The apparatus comprises a processor and a memory storing computer program instructions; The processor reads and executes the computer program instructions to implement the communication method according to any one of claims 1 to 4.

9. A computer storage medium, characterized in that: The computer storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the communication method according to any one of claims 1 to 4 is implemented.

10. A vehicle, characterized in that: Include at least one of the following: The communication device as claimed in claim 5; The electronic device as claimed in claim 8; The computer storage medium of claim 9.