Automatic reverse communication method and device based on forward communication
By acquiring and processing the forward communication relationship, establishing a reverse data receiving buffer, and performing reverse communication operations, the problem of multi-source data retention and four-dimensional variational assimilation calculations is solved, and the reverse calculation of four-dimensional variational assimilation is realized and simplified. research and development process.
Patent Information
- Application Number
- CN202410701401.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-03
AI Technical Summary
The existing technology cannot effectively store multi-source data, is difficult to perform reverse calculation of four-dimensional variational assimilation, and cannot directly use a general parallel framework to automatically construct the reverse process of forward communication.
By obtaining the forward communication relationship of each process participating in the target application, determining the communication number, establishing a reverse data receiving buffer, and performing reverse communication operations according to the mapping relationship, the reverse calculation of four-dimensional variational assimilation is realized.
It solves the problem of multi-source data retention, realizes the reverse calculation of four-dimensional variational assimilation, simplifies the research and development process, and reduces the workload.
Smart Images

Figure CN118585350A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data transmission, and in particular to an automatic reverse communication method and device based on forward communication. Background Art
[0002] When developing a parallel version of a numerical application, developers first need to assign all grid points of the grid to different processes for parallel computing. Figure 1 As shown in (a), the square grid area is divided into four non-overlapping sub-areas, and all grid points in each sub-area are calculated by one process.
[0003] Numerical calculation methods usually introduce data dependencies between grid points (that is, when calculating the data on one grid point, the data on other grid points are required). This means that in the process of parallel calculations by multiple processes, one process will use the data on the grid points that other processes are responsible for calculating. Therefore, a process not only needs to store the data on the grid points that it is responsible for calculating, but also needs to store the data that it needs but is calculated by other processes. For a process, the area composed of the grid points that it is responsible for calculating is called the calculation area, and the area composed of the grid points that it needs to use but does not calculate is called the shadow area (that is, the shadow of the results calculated by other processes). For example, Figure 1 (a) and Figure 1 As shown in (b), the small rectangle with solid lines on the edge is the calculation area of each process, the shadow between the solid line and the dotted line is the image area, and the rectangle with dotted lines on the edge is the parallel partition. Figure 1 (a) and Figure 1 (b) It can be seen that the image area is usually located in the outer circle of the calculation area.
[0004] The data on the grid points in the image area of a process is calculated by other processes. When the data in the image area needs to be used, it is necessary to complete the data exchange for the image area between processes first, that is, to transfer part of the data calculated by one process to the image area of another process based on the communication method. This requires establishing the communication relationship between processes based on the parallel partitioning and the dependency relationship between grid points (for example, which MPI processes an MPI process exchanges data with), and completing the data packaging, communication, and unpacking during the data exchange process. In order to simplify the program implementation, it is often necessary to develop a convenient and easy-to-use parallel communication library. The prior art has proposed a general parallel framework for numerical applications, which can conveniently realize adaptive communication between processes under any grid structure, any parallel partitioning, and any image area structure, automatically determine the data communication relationship between processes, and automatically complete the data packaging, communication, and unpacking. The core idea of the general parallel framework is to number all grid points, each grid point has a unique number, and then determine the data communication relationship between processes according to the number of each grid point in the calculation area and image area of each process.
[0005] The accuracy of the forecast results of the numerical weather forecast program is greatly affected by the quality of the initial values. Data assimilation improves the initial forecast values by effectively combining observational data and numerical weather forecast programs, which is crucial to improving weather forecast results. Four-dimensional variational assimilation is currently the most advanced assimilation method. However, four-dimensional variational assimilation is very difficult to develop. It is necessary to develop a reverse calculation process (tangent linear adjoint process) based on the forward calculation of the numerical forecast program, including the development of reverse communication functions for forward communication. Similar to the existing general parallel framework, if the reverse communication of the forward communication can be automatically generated, the workload of developing the reverse calculation process can be greatly reduced.
[0006] It is understandable that the reverse communication process also belongs to data communication, so the general parallel framework can automatically implement the reverse communication process. However, it cannot be understood so simply. Figure 2 A common forward communication process diagram is shown in Figure 1. Figure 2 As shown, each color represents all grid points calculated by each process, and the arrows represent the direction of data communication of the blue process; Figure 3 This is a common reverse communication process diagram. Figure 2 The lower right grid point of the blue process has three different destinations in the forward communication ( Figure 2 ), so its Figure 3There are three different sources in the reverse communication process. The general parallel framework can conveniently support data communication from one source grid point to multiple destination grid points. At this time, it is only necessary to let one source grid point and multiple destination grid points use the same grid point number; when data communication is required from multiple source grid points to the same destination grid point, if these grid points all use the same grid point number, the general parallel framework will make the destination grid point retain only data from one source, and the data from other sources can only be overwritten or discarded. Therefore
[0007] In summary, the existing technology cannot effectively store multi-source data, has difficulty in performing reverse calculations of four-dimensional variational assimilation, and cannot directly use a general parallel framework to automatically construct the reverse process of forward communication, which needs to be solved urgently. Summary of the invention
[0008] The present application provides an automatic reverse communication method and device based on forward communication to solve the problems that the prior art cannot effectively store multi-source data, is difficult to perform reverse calculation of four-dimensional variational assimilation, and cannot directly use a general parallel framework to automatically construct the reverse process of forward communication.
[0009] The first aspect of the present application provides an automatic reverse communication method based on forward communication, comprising the following steps: obtaining each process in the target application that participates in the existing forward communication, and determining at least one forward data communication relationship between each process; determining the communication number of each forward data communication relationship in the at least one forward data communication relationship, and establishing a reverse data receiving buffer according to the communication number, and constructing a first keyword corresponding to each grid point in the reverse data receiving buffer to record the mapping relationship between each grid point in the reverse data receiving buffer and each source grid point in the existing forward communication; obtaining a second keyword corresponding to each destination grid point in the existing forward communication, and performing reverse communication operations from each destination grid point to each source grid point in the existing forward communication based on the reverse data receiving buffer, the second keyword and the mapping relationship.
[0010] Optionally, in one embodiment of the present application, determining the communication number of each forward data communication relationship in the at least one forward data communication relationship includes: determining the number of all forward data communication relationships between each process; and setting a corresponding communication number for each forward data communication relationship according to the number and a preset numbering strategy.
[0011] Optionally, in one embodiment of the present application, establishing a reverse data receiving buffer according to the communication number and constructing a first keyword corresponding to each grid point in the reverse data receiving buffer includes: determining the number of grid points in the reverse data receiving buffer corresponding to each process based on the number of all forward data communication relationships, and determining a first correspondence between each grid point in the reverse data receiving buffer and each forward data communication relationship and the corresponding source grid point in the existing forward communication based on all the forward data communication relationships, so as to construct a first keyword corresponding to the first correspondence.
[0012] Optionally, in one embodiment of the present application, the second keyword corresponding to each destination grid point in the existing forward communication is obtained, and based on the reverse data receiving buffer, the second keyword and the mapping relationship, the reverse communication operation from each destination grid point in the existing forward communication to each source grid point is performed, including: establishing a second corresponding relationship between each destination grid point in the existing forward communication and each forward data communication relationship, and determining the second keyword according to the communication number of each forward data communication relationship and the second corresponding relationship; based on a preset general parallel strategy and the second keyword, sending reverse communication data from each destination grid point in the existing forward communication to the reverse data receiving buffer; when the reverse data receiving buffer receives the reverse communication data, based on the mapping relationship or the first keyword, and updating each source grid point through each grid point in the reverse data receiving buffer.
[0013] The second aspect of the present application provides an automatic reverse communication device based on forward communication, including: an acquisition module, used to acquire each process participating in the existing forward communication in the target application, and determine at least one forward data communication relationship between each process; a construction module, used to determine the communication number of each forward data communication relationship in the at least one forward data communication relationship, and establish a reverse data receiving buffer according to the communication number, and construct a first keyword corresponding to each grid point in the reverse data receiving buffer to record the mapping relationship between each grid point in the reverse data receiving buffer and each source grid point in the existing forward communication; a reverse communication module, used to acquire a second keyword corresponding to each destination grid point in the existing forward communication, and based on the reverse data receiving buffer, the second keyword and the mapping relationship, perform reverse communication operations from each destination grid point to each source grid point in the existing forward communication.
[0014] Optionally, in one embodiment of the present application, the construction module includes: a first determination unit, used to determine the number of all forward data communication relationships between each process; and a setting unit, used to set a corresponding communication number for each forward data communication relationship according to the number and a preset numbering strategy.
[0015] Optionally, in one embodiment of the present application, the construction module also includes: a second determination unit, used to determine the number of grid points in the reverse data receiving buffer corresponding to each process based on the number of all forward data communication relationships, and determine the first correspondence between each grid point in the reverse data receiving buffer and each forward data communication relationship and the corresponding source grid point in the existing forward communication based on all the forward data communication relationships, so as to construct a first keyword corresponding to the first correspondence.
[0016] Optionally, in one embodiment of the present application, the reverse communication module includes: an establishing unit, used to establish a second corresponding relationship between each destination grid point in the existing forward communication and each forward data communication relationship, and determine the second keyword based on the communication number of each forward data communication relationship and the second corresponding relationship; a sending unit, used to send reverse communication data from each destination grid point in the existing forward communication to the reverse data receiving buffer based on a preset general parallel strategy and the second keyword; an updating unit, used to update each source grid point based on the mapping relationship or the first keyword and through each grid point in the reverse data receiving buffer when the reverse communication data is received in the reverse data receiving buffer.
[0017] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the automatic reverse communication method based on forward communication as described in the above embodiment.
[0018] The fourth aspect of the present application provides a computer-readable storage medium, which stores a computer program. When the program is executed by a processor, it implements the above-mentioned automatic reverse communication method based on forward communication.
[0019] Therefore, the embodiments of the present application have the following beneficial effects:
[0020] The embodiment of the present application can obtain each process participating in the existing forward communication in the target application, and determine at least one forward data communication relationship between each process; determine the communication number of each forward data communication relationship in at least one forward data communication relationship, and establish a reverse data receiving buffer according to the communication number, and construct a first keyword corresponding to each grid point in the reverse data receiving buffer to record the mapping relationship between each grid point in the reverse data receiving buffer and each source grid point in the existing forward communication; obtain the second keyword corresponding to each destination grid point in the existing forward communication, and based on the reverse data receiving buffer, the second keyword and the mapping relationship, perform the reverse communication operation from each destination grid point in the existing forward communication to each source grid point, so as to perform the reverse calculation of the four-dimensional variational assimilation. Thus, the problems that the prior art cannot effectively retain multi-source data, it is difficult to perform the reverse calculation of the four-dimensional variational assimilation, and it is impossible to directly use the general parallel framework to automatically construct the reverse process of the forward communication.
[0021] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0023] Figure 1 A schematic diagram of the distribution of computing areas for each process provided by this application;
[0024] Figure 2 A common forward communication process diagram provided for this application;
[0025] Figure 3 A common reverse communication process diagram provided for this application;
[0026] Figure 4 A flowchart of an automatic reverse communication method based on forward communication provided according to an embodiment of the present application;
[0027] Figure 5 A schematic diagram of a data receiving buffer provided for an embodiment of the present application;
[0028] Figure 6 This is an exemplary diagram of an automatic reverse communication device based on forward communication according to an embodiment of the present application;
[0029] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0030] Among them, 10 is an automatic reverse communication device based on forward communication; 100 is an acquisition module, 200 is a construction module, 300 is a reverse communication module; 701 is a memory, 702 is a processor, and 703 is a communication interface. DETAILED DESCRIPTION
[0031] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0032] The following describes the automatic reverse communication method and device based on forward communication of the embodiment of the present application with reference to the accompanying drawings. In view of the problems mentioned in the above background technology, the present application provides an automatic reverse communication method based on forward communication, in which each process participating in the existing forward communication in the target application is obtained, and at least one forward data communication relationship between each process is determined; the communication number of each forward data communication relationship in at least one forward data communication relationship is determined, and a reverse data receiving buffer is established according to the communication number, and a first keyword corresponding to each grid point in the reverse data receiving buffer is constructed to record the mapping relationship between each grid point in the reverse data receiving buffer and each source grid point in the existing forward communication; the second keyword corresponding to each destination grid point in the existing forward communication is obtained, and based on the reverse data receiving buffer, the second keyword and the mapping relationship, the reverse communication operation from each destination grid point in the existing forward communication to each source grid point is performed, so that the reverse calculation of four-dimensional variational assimilation can be performed. Thus, the problems that the prior art cannot effectively retain multi-source data, it is difficult to perform reverse calculation of four-dimensional variational assimilation, and it is impossible to directly use a general parallel framework to automatically construct the reverse process of forward communication.
[0033] Specifically, Figure 4 A flowchart of an automatic reverse communication method based on forward communication provided in an embodiment of the present application.
[0034] like Figure 4 As shown, the automatic reverse communication method based on forward communication includes the following steps:
[0035] In step S401, each process in the target application that participates in the existing forward communication is obtained, and at least one forward data communication relationship between each process is determined.
[0036] In step S402, the communication number of each forward data communication relationship in at least one forward data communication relationship is determined, and a reverse data receiving buffer is established according to the communication number, and a first keyword corresponding to each grid point in the reverse data receiving buffer is constructed to record the mapping relationship between each grid point in the reverse data receiving buffer and each source grid point in the existing forward communication.
[0037] The embodiments of the present application can first obtain all processes of the target application participating in forward communication, and obtain all forward data communication relationships between all processes in the forward communication, wherein each forward data communication relationship is data communication from a source grid point of one process to a destination grid point of another process.
[0038] It should be noted that the embodiments of the present application can automatically establish reverse communication based on the existing forward communication between processes. The embodiments of the present application can easily obtain all processes participating in the forward communication from the existing forward communication, and obtain all forward data communication relationships. A forward data communication relationship is from a source grid point to a destination grid point. When the data of a source grid point is to be sent to multiple destination grid points (such as Figure 1 ), which means multiple positive data communication relationships.
[0039] Furthermore, the embodiment of the present application can determine the communication numbers of all forward data communication relationships, and then the embodiment of the present application can establish a data receiving buffer for reverse communication (such as Figure 5 As shown in the red box in the figure, a mapping relationship between the keyword (i.e., the first keyword) of each grid point in the data receiving buffer and its source grid points for forward communication is constructed.
[0040] Optionally, in one embodiment of the present application, determining the communication number of each forward data communication relationship in at least one forward data communication relationship includes: determining the number of all forward data communication relationships between each process; setting a corresponding communication number for each forward data communication relationship according to the number and a preset numbering strategy.
[0041] As an achievable method, the embodiment of the present application may first obtain the number of all forward data communication relationships of all processes, and set this number as N, and then set a corresponding communication number for each forward data communication relationship according to the number and the preset numbering strategy, for example. The embodiment of the present application may use natural numbers from 1 to N to number each forward data communication relationship of all processes, so that the pass number of each forward data communication relationship is unique.
[0042] Optionally, in one embodiment of the present application, a reverse data receiving buffer is established according to the communication number, and a first keyword corresponding to each grid point in the reverse data receiving buffer is constructed, including: based on the number of all forward data communication relationships, determining the number of grid points in the reverse data receiving buffer corresponding to each process, and determining the first correspondence between each grid point in the reverse data receiving buffer and each forward data communication relationship and the corresponding source grid point in the existing forward communication based on all forward data communication relationships, so as to construct a first keyword corresponding to the first correspondence.
[0043] It should be noted that the embodiments of the present application first need to determine the number of grid points in the data receiving buffer of each process. When a process is a sending process of M forward data communication relationships, the data receiving buffer of the process has M grid points, where each grid point corresponds to a forward data communication relationship. The embodiments of the present application can use the number of this data communication relationship as the keyword of the grid point (i.e., the first keyword).
[0044] It is understandable that in the embodiment of the present application, the data of each grid point in a process data receiving buffer will be used to update a corresponding source grid point of the forward communication in the process. Therefore, the embodiment of the present application needs to establish a mapping relationship between each grid point in the data receiving buffer of each process and a corresponding source grid point of the process, so that the update calculation of the data in the calculation area based on the data receiving buffer can be realized efficiently and quickly according to the mapping relationship.
[0045] In step S403, the second keyword corresponding to each destination grid point in the existing forward communication is obtained, and based on the reverse data receiving buffer, the second keyword and the mapping relationship, a reverse communication operation from each destination grid point to each source grid point in the existing forward communication is performed.
[0046] Furthermore, the embodiments of the present application can also determine the keyword (i.e., the second keyword) of each destination grid point of the forward communication, and based on the data receiving buffer, the second keyword and the mapping relationship, realize reverse communication from all destination grid points of the forward data communication to all source grid points of the forward data communication.
[0047] Optionally, in one embodiment of the present application, a second keyword corresponding to each destination grid point in the existing forward communication is obtained, and based on the reverse data receiving buffer, the second keyword and the mapping relationship, a reverse communication operation from each destination grid point in the existing forward communication to each source grid point is performed, including: establishing a second corresponding relationship between each destination grid point in the existing forward communication and each forward data communication relationship, and determining the second keyword according to the communication number of each forward data communication relationship and the second corresponding relationship; based on a preset general parallel strategy and the second keyword, sending reverse communication data from each destination grid point in the existing forward communication to the reverse data receiving buffer; when the reverse data receiving buffer receives the reverse communication data, based on the mapping relationship or the first keyword, and updating each source grid point through each grid point in the reverse data receiving buffer.
[0048] In the actual execution process, each destination grid point of the above-mentioned forward communication corresponds to a forward data communication relationship. Therefore, the embodiment of the present application can use the number of the data communication relationship corresponding to each destination grid point as the keyword of the destination grid point (ie, the second keyword).
[0049] In addition, since each grid point in the data receiving buffer has the same keyword setting rules as each destination grid point in the forward communication, the embodiments of the present application can be based on these keywords and use the existing general parallel strategy to automatically realize data communication from each destination grid point in the forward communication to each grid point in the data receiving buffer. After the data receiving buffer receives the communication data, the above-mentioned mapping relationship is used to update the communication data of each grid point in the data receiving buffer and the communication data of the corresponding source grid point of the forward communication, and the updated communication data is sent from each destination grid point to each source grid point, thereby realizing automatic reverse communication.
[0050] According to the automatic reverse communication method based on forward communication proposed in the embodiment of the present application, each process participating in the existing forward communication in the target application is obtained, and at least one forward data communication relationship between each process is determined; the communication number of each forward data communication relationship in at least one forward data communication relationship is determined, and a reverse data receiving buffer is established according to the communication number, and a first keyword corresponding to each grid point in the reverse data receiving buffer is constructed to record the mapping relationship between each grid point in the reverse data receiving buffer and each source grid point in the existing forward communication; the second keyword corresponding to each destination grid point in the existing forward communication is obtained, and based on the reverse data receiving buffer, the second keyword and the mapping relationship, a reverse communication operation from each destination grid point to each source grid point in the existing forward communication is performed, so that reverse calculation of four-dimensional variational assimilation can be performed.
[0051] Next, an automatic reverse communication device based on forward communication proposed in accordance with an embodiment of the present application is described with reference to the accompanying drawings.
[0052] Figure 6 It is a block diagram of an automatic reverse communication device based on forward communication according to an embodiment of the present application.
[0053] like Figure 6 As shown, the automatic reverse communication device 10 based on forward communication includes: an acquisition module 100 , a construction module 200 and a reverse communication module 300 .
[0054] The acquisition module 100 is used to acquire each process in the target application that participates in the existing forward communication, and determine at least one forward data communication relationship between each process.
[0055] Construction module 200 is used to determine the communication number of each forward data communication relationship in at least one forward data communication relationship, and establish a reverse data receiving buffer according to the communication number, and construct a first keyword corresponding to each grid point in the reverse data receiving buffer to record the mapping relationship between each grid point in the reverse data receiving buffer and each source grid point in the existing forward communication.
[0056] The reverse communication module 300 is used to obtain the second keyword corresponding to each destination grid point in the existing forward communication, and based on the reverse data receiving buffer, the second keyword and the mapping relationship, perform reverse communication operations from each destination grid point to each source grid point in the existing forward communication.
[0057] Optionally, in one embodiment of the present application, the construction module 200 includes: a first determining unit and a setting unit.
[0058] The first determining unit is used to determine the number of all forward data communication relationships between each process.
[0059] The setting unit is used to set a corresponding communication number for each forward data communication relationship according to the quantity and the preset numbering strategy.
[0060] Optionally, in one embodiment of the present application, the construction module 200 further includes: a second determination unit.
[0061] Among them, the second determination unit is used to determine the number of grid points in the reverse data receiving buffer corresponding to each process based on the number of all forward data communication relationships, and determine the first correspondence between each grid point in the reverse data receiving buffer and each forward data communication relationship and the corresponding source grid point in the existing forward communication according to all forward data communication relationships, so as to construct the first keyword corresponding to the first correspondence.
[0062] Optionally, in one embodiment of the present application, the reverse communication module 300 includes: an establishing unit, a sending unit and an updating unit.
[0063] The establishing unit is used to establish a second corresponding relationship between each destination grid point in the existing forward communication and each forward data communication relationship, and determine the second keyword according to the communication number of each forward data communication relationship and the second corresponding relationship.
[0064] The sending unit is used to send reverse communication data from each destination grid point in the existing forward communication to the reverse data receiving buffer zone based on a preset general parallel strategy and a second keyword.
[0065] The updating unit is used for updating each source grid point through each grid point in the reverse data receiving buffer according to the mapping relationship or the first keyword when the reverse data receiving buffer receives the reverse communication data.
[0066] It should be noted that the aforementioned explanation of the embodiment of the automatic reverse communication method based on forward communication is also applicable to the automatic reverse communication device based on forward communication in this embodiment, and will not be repeated here.
[0067] According to the automatic reverse communication device based on forward communication proposed in the embodiment of the present application, it includes an acquisition module, which is used to acquire each process participating in the existing forward communication in the target application, and determine at least one forward data communication relationship between each process; a construction module, which is used to determine the communication number of each forward data communication relationship in at least one forward data communication relationship, and establish a reverse data receiving buffer according to the communication number, and construct a first keyword corresponding to each grid point in the reverse data receiving buffer to record the mapping relationship between each grid point in the reverse data receiving buffer and each source grid point in the existing forward communication; a reverse communication module, which is used to acquire a second keyword corresponding to each destination grid point in the existing forward communication, and based on the reverse data receiving buffer, the second keyword and the mapping relationship, perform reverse communication operations from each destination grid point to each source grid point in the existing forward communication, so as to enable reverse calculation of four-dimensional variational assimilation.
[0068] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0069] A memory 701 , a processor 702 , and a computer program stored in the memory 701 and executable on the processor 702 .
[0070] When the processor 702 executes the program, the automatic reverse communication method based on forward communication provided in the above embodiment is implemented.
[0071] Furthermore, the electronic device further comprises:
[0072] The communication interface 703 is used for communication between the memory 701 and the processor 702 .
[0073] The memory 701 is used to store computer programs that can be executed on the processor 702 .
[0074] The memory 701 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0075] If the memory 701, the processor 702 and the communication interface 703 are implemented independently, the communication interface 703, the memory 701 and the processor 702 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0076] Optionally, in a specific implementation, if the memory 701, the processor 702 and the communication interface 703 are integrated on a chip, the memory 701, the processor 702 and the communication interface 703 can communicate with each other through an internal interface.
[0077] The processor 702 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0078] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the automatic reverse communication method based on forward communication as described above is implemented.
[0079] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0080] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0081] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0082] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.
[0083] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0084] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0085] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0086] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. An automatic reverse communication method based on forward communication, characterized in that: The following steps are involved: Acquire each process in the target application that participates in the existing forward communication, and determine at least one forward data communication relationship between each of the processes; Determine the communication number of each forward data communication relationship in the at least one forward data communication relationship, establish a reverse data receiving buffer according to the communication number, and construct a first keyword corresponding to each grid point in the reverse data receiving buffer to record the mapping relationship between each grid point in the reverse data receiving buffer and each source grid point in the existing forward communication; The second keyword corresponding to each destination grid point in the existing forward communication is obtained, and based on the reverse data receiving buffer, the second keyword and the mapping relationship, a reverse communication operation from each destination grid point in the existing forward communication to each source grid point is performed.
2. The method according to claim 1, characterized in that The determining of the communication number of each forward data communication relationship in the at least one forward data communication relationship comprises: determining the number of all forward data communication relationships between each of the processes; A corresponding communication number is set for each forward data communication relationship according to the quantity and a preset numbering strategy.
3. The method according to claim 2, characterized in that The step of establishing a reverse data receiving buffer according to the communication number and constructing a first keyword corresponding to each grid point in the reverse data receiving buffer to record a mapping relationship between each grid point in the reverse data receiving buffer and each source grid point in the existing forward communication includes: Based on the number of all the forward data communication relationships, the number of grid points in the reverse data receiving buffer corresponding to each process is determined, and based on all the forward data communication relationships, a first corresponding relationship between each grid point in the reverse data receiving buffer and each forward data communication relationship and the corresponding source grid point in the existing forward communication is determined to construct a first keyword corresponding to the first corresponding relationship.
4. The method according to claim 1, characterized in that: The obtaining of the second keyword corresponding to each destination grid point in the existing forward communication, and performing a reverse communication operation from each destination grid point to each source grid point in the existing forward communication based on the reverse data receiving buffer, the second keyword and the mapping relationship, includes: Establishing a second corresponding relationship between each destination grid point in the existing forward communication and each forward data communication relationship, and determining the second keyword according to the communication number of each forward data communication relationship and the second corresponding relationship; Based on a preset general parallel strategy and the second keyword, sending reverse communication data from each destination grid point in the existing forward communication to the reverse data receiving buffer; When the reverse communication data is received in the reverse data receiving buffer, each source grid point is updated through each grid point in the reverse data receiving buffer based on the mapping relationship or the first keyword.
5. An automatic reverse communication device based on forward communication, characterized in that: include: An acquisition module, used for acquiring each process in the target application program that participates in the existing forward communication, and determining at least one forward data communication relationship between each of the processes; A construction module, used to determine the communication number of each forward data communication relationship in the at least one forward data communication relationship, and establish a reverse data receiving buffer according to the communication number, and construct a first keyword corresponding to each grid point in the reverse data receiving buffer to record the mapping relationship between each grid point in the reverse data receiving buffer and each source grid point in the existing forward communication; The reverse communication module is used to obtain the second keyword corresponding to each destination grid point in the existing forward communication, and based on the reverse data receiving buffer, the second keyword and the mapping relationship, perform the reverse communication operation from each destination grid point in the existing forward communication to each source grid point.
6. The device according to claim 5, characterized in that The building blocks include: A first determining unit, configured to determine the number of all forward data communication relationships between each of the processes; A setting unit is used to set a corresponding communication number for each forward data communication relationship according to the quantity and a preset numbering strategy.
7. The device according to claim 6, characterized in that The building blocks also include: The second determination unit is used to determine the number of grid points in the reverse data receiving buffer corresponding to each process based on the number of all forward data communication relationships, and determine the first corresponding relationship between each grid point in the reverse data receiving buffer and each forward data communication relationship and the corresponding source grid point in the existing forward communication according to all the forward data communication relationships, so as to construct a first keyword corresponding to the first corresponding relationship.
8. The device according to claim 5, characterized in that The reverse communication module comprises: An establishing unit, used to establish a second corresponding relationship between each destination grid point in the existing forward communication and each forward data communication relationship, and determine the second keyword according to the communication number of each forward data communication relationship and the second corresponding relationship; A sending unit, configured to send reverse communication data from each destination grid point in the existing forward communication to the reverse data receiving buffer based on a preset general parallel strategy and the second keyword; An updating unit is used for updating each source grid point through each grid point in the reverse data receiving buffer based on the mapping relationship or the first keyword when the reverse communication data is received in the reverse data receiving buffer.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the automatic reverse communication method based on forward communication as described in any one of claims 1 to 4.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the automatic reverse communication method based on forward communication as described in any one of claims 1 to 4.
