CN118132289A - Local communication method, system, equipment, storage medium and product - Google Patents

Local communication method, system, equipment, storage medium and product Download PDF

Info

Publication number
CN118132289A
CN118132289A CN202410260936.1A CN202410260936A CN118132289A CN 118132289 A CN118132289 A CN 118132289A CN 202410260936 A CN202410260936 A CN 202410260936A CN 118132289 A CN118132289 A CN 118132289A
Authority
CN
China
Prior art keywords
data
notification
response
event
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410260936.1A
Other languages
Chinese (zh)
Inventor
郭昌盛
邱斌
李华生
王磊
姜昱西
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jiangmin Xinke Technology Co ltd
Original Assignee
Beijing Jiangmin Xinke Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jiangmin Xinke Technology Co ltd filed Critical Beijing Jiangmin Xinke Technology Co ltd
Priority to CN202410260936.1A priority Critical patent/CN118132289A/en
Publication of CN118132289A publication Critical patent/CN118132289A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a local communication method, a system, equipment, a storage medium and a product, wherein a local file is initialized to be used as a carrier file, and the method comprises a notification data area and a response data area; the sender process and the receiver process register a change notification callback function of the carrier file; when a sender process sends notification data through an event sending interface, writing the notification data into a notification data area, and distributing a sending event ID; the receiving process receives the notification data through the notification receiving interface; the receiving process writes the response data into the response data area through the response interface and distributes the corresponding response event ID; the sender process receives response data through the event sending interface; and feeding back response data to task logic corresponding to the notification data according to the sending event ID and the corresponding response event ID. By adopting the technical scheme of the invention, one set of code logic can support the compiling and running of different system platforms, and is instant, efficient and low in consumption.

Description

Local communication method, system, equipment, storage medium and product
Technical Field
The present invention relates to the field of computer operating systems, and in particular, to a local communication method, system, device, storage medium, and product.
Background
Local intra-process and inter-process communication is a technology frequently used in software design and development, but with the wide use of a linux system and a domestic system, local communication modes frequently used in a windows system, such as a pipeline, a shared memory, a socket and the like, have increasingly limited problems in cross-platform technology implementation and environment application and limited problems caused by the influence of system environment on technology implementation, and a general, efficient and low-consumption communication party and data transmission technology for cross-platform technology implementation cannot be found.
The common software realizes the same communication mode and interface by using different technologies according to different systems on the cross-platform, the technology of the mode is complex to realize, a certain threshold is provided, and a developer needs to know the technology of all the platforms to maintain, so that the maintenance cost is high. Some software uses socket local network communication (127.0.0.1) to implement cross-platform communication technology, but this mode needs socket interface, and relies on network communication. If the computer is not provided with a network card or a network driver, the computer cannot be used, and some network ports are occupied, and the network ports serve as limited resources, so that the system performance is reduced. Some software uses the technical mode of shared memory to realize communication, but the cross-platform is supported, but a large amount of system memory is occupied, if the system memory has less influence on the communication efficiency, the communication is limited by system resources.
At present, in the implementation of the local communication technology, a single platform function is usually used for a lot, for example, only the local communication function of windows or linux systems is supported, the implementation technology is the local communication realized by the existing communication technology aiming at a fixed platform, if the cross-platform support is to be realized, all the technologies can be combined together, and different communication modes are started through different platforms to achieve multi-platform support.
Some vendors implement Remote Procedure Calls (RPCs) through local network communications to achieve a cross-platform local communication mode. The method has the advantages of simple realization, local communication based on network communication in practice, and all platform support can be realized by one set of codes, but has the disadvantages of depending on a network, needing a network card in a system environment and installing a network card driver.
The simple data storage and reading function realized by using files, databases and the like is the conventional logic of software, but the operation is only a simple file read-write operation, and the purpose of instant messaging cannot be achieved or the capability of communication response feedback is provided.
The function realized by the file change notification callback technology of the system is mainly to monitor file change in real time aiming at the files of the designated files or catalogues, and is used for making some inherent operation logics after the file change, and also does not have basic communication capability or communication response callback capability.
Therefore, in the existing local communication technology implementation, no cross-platform local communication technology implementation scheme for the whole platform is provided, or a single platform function is generally adopted for most, the implementation technology can only realize local communication for a specific platform, if cross-platform support is required, the related communication technologies of all platforms can be combined together to form a comprehensive local communication module, a unified communication interface is provided for the outside, but different communication technologies are used for different platforms in the inside, the mode can achieve the purpose of supporting most of the platforms, but cannot achieve the compatibility of the whole platform, because some communication technologies such as pipelines, shared memories, databases, registries, message queues, kernel communication interfaces and the like cannot support all the known platforms in the prior art, and the code logic is complex.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide a local communication method, system, device, storage medium, and product supporting a full platform, which can solve the problems existing in the prior art.
In a first aspect, an embodiment of the present disclosure provides a local communication method, including the steps of:
Initializing a local file as a carrier file;
logically formatting the carrier file, wherein the carrier file comprises a notification data area and a response data area, the notification data area is used for storing sent notification data, and the response data area is used for storing response data received back;
the sender process registers a first change notification callback function of the carrier file, which is used for monitoring a response data area of the carrier file, and the receiver process registers a second change notification callback function of the carrier file, which is used for monitoring a notification data area of the carrier file;
When the sender process sends data to the receiver process through an event sending interface, the sender process takes the data as notification data, writes the notification data into a notification data area of the carrier file, and distributes a sending event ID and a message ID;
after the second change notification callback function receives the notification, the receiver process receives data from the second change notification callback function through a notification receiving interface, and completes the receiving processing of the notification data after passing through upper-layer application processing logic;
when the receiving process responds back, writing response data into a response data area of the carrier file through a response interface, and distributing corresponding response event ID and message ID;
After the first change notification callback function receives the notification, the sender process receives data from the first change notification callback function through an event sending interface, and completes receiving processing of the response data after upper-layer application processing logic;
And feeding back response data to task logic corresponding to the notification data according to the sending event ID and the corresponding response event ID.
Further, the event sending interface is provided with a synchronous interface and an asynchronous sending interface which block the sending state, and the synchronous interface returns only when receiving a response and returns response data; and the asynchronous sending interface returns after sending data, no response data is returned at the moment, and the callback function is informed to acquire the response data of the receiver process through the first change.
Further, the carrier file is logically formatted to resemble a cellular structure for supporting data insertion into the carrier file during concurrent communications.
Further, the carrier file includes not less than two carrier files for multi-channel communication.
In a second aspect, the disclosed embodiments also provide a local communication system, including a carrier file unit, a sender process unit, a receiver process unit, an event sending interface unit, a notification receiving interface unit, a response interface unit, and a task logic unit, where the carrier file unit further includes an initialization module, a formatting module, a notification data module, and a response data module,
The initialization module is used for initializing a local file as a carrier file;
The formatting module is used for logically formatting the carrier file;
the notification data module is used for storing the sent notification data;
The response data module is used for storing and receiving the returned response data;
The sender process unit is used for registering a first change notification callback function of the carrier file, monitoring the response data module, sending notification data through the event sending interface unit, writing the notification data module, distributing and sending event ID and message ID, receiving data from the first change notification callback function through the event sending interface unit after the first change notification callback function receives the notification, and completing receiving processing of the response data through upper application processing logic;
The receiving process unit is used for registering a second change notification callback function of the carrier file, monitoring the notification data module, receiving data from the second change notification callback function through the notification receiving interface unit after the second change notification callback function receives the notification, completing receiving processing of the notification data after upper-layer application processing logic, and writing response data into the response data module through the response interface unit when response is returned, and distributing corresponding response event ID and message ID;
And the task logic unit is used for feeding back response data to task logic corresponding to the notification data according to the sending event ID and the corresponding response event ID.
Further, the carrier file unit includes at least two carrier file units for multi-channel communication; the event transmission interface unit is provided with a synchronous interface module and an asynchronous transmission interface module which block the transmission state, and the synchronous interface module is used for returning only when receiving a response and returning response data; the asynchronous sending interface module is used for sending data and returning the data, and the response data of the receiver process is obtained through the first change notification callback function without returning the response data.
Further, the carrier file unit is logically formatted to resemble a cellular structure for supporting data insertion into the carrier file during concurrent communications.
In a third aspect, embodiments of the present disclosure further provide an electronic device, including:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor, which when executed by the at least one processor, cause the at least one processor to perform the local communication method of any of the preceding first aspect or any implementation of the first aspect.
In a fourth aspect, the presently disclosed embodiments also provide a non-transitory computer-readable storage medium storing computer instructions that, when executed by at least one processor, cause the at least one processor to perform the local communication method of the first aspect or any implementation of the first aspect.
In a fifth aspect, embodiments of the present disclosure also provide a computer program product comprising a computer program which, when executed by a processor, implements the local communication method of the first aspect or any implementation manner of the first aspect.
According to the local communication method supporting the full platform, the local file is used for data transmission, dependence on environment and third-party technology is avoided, the file system is only relied on, the file system is a basic service function which each operating system needs to carry, and the file change notification interface is a basic interface which each operating system platform is provided with, so that pure file operation and communication processing logic are realized; a set of code logic can support the compiling and running of different system platforms, and the cross-platform communication is supported without the need of distinguishing the compiling of the system environment and the mixing of various communication technologies; the file change notification is utilized to notify the receiver at the first time after the data is sent, and the receiver can immediately take the data; the method has no network port and memory occupation, and can achieve the inter-process data communication of a large amount of data by occupying little space of a local disk.
Drawings
The foregoing is merely an overview of the present invention, and the present invention is further described in detail below with reference to the accompanying drawings and detailed description.
FIG. 1 is a flow chart of local communication supporting a full platform provided by an embodiment of the present disclosure;
FIG. 2 is a timing diagram of a local communication algorithm supporting a full platform provided by an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a local communication system supporting a full platform according to an embodiment of the present disclosure; and
Fig. 4 is a schematic diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
Other advantages and effects of the present disclosure will become readily apparent to those skilled in the art from the following disclosure, which describes embodiments of the present disclosure by way of specific examples. It will be apparent that the described embodiments are merely some, but not all embodiments of the present disclosure. The disclosure may be embodied or practiced in other different specific embodiments, and details within the subject specification may be modified or changed from various points of view and applications without departing from the spirit of the disclosure. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict. All other embodiments, which can be made by one of ordinary skill in the art without inventive effort, based on the embodiments in this disclosure are intended to be within the scope of this disclosure.
It is noted that various aspects of the embodiments are described below within the scope of the following claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the present disclosure, one skilled in the art will appreciate that one aspect described herein may be implemented independently of any other aspect, and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. In addition, such apparatus may be implemented and/or such methods practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
It should also be noted that the illustrations provided in the following embodiments merely illustrate the basic concepts of the disclosure by way of illustration, and only the components related to the disclosure are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complicated.
In addition, in the following description, specific details are provided in order to provide a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects may be practiced without these specific details.
The technical scheme of the invention is a local communication scheme supporting a full-system platform (comprising windows, linux and a domestic system). The system utilizes a file change notification interface of the system to achieve the aim of communication by transmitting information through files, and realizes a multi-task parallel notification and asynchronous response mechanism. The technical scheme of the invention utilizes the file change notification which is universal for all systems, can provide instant information notification of a full platform, and realizes asynchronous response through asynchronous processing logic. The key point of the invention is that the file is fully utilized to carry out information transfer, the full platform system is supported, the system is light in weight, has no environment dependence and no network dependence, and can support functions such as intra-process, inter-process communication or interface call.
FIG. 1 is a flow chart of local communication supporting a full platform provided by an embodiment of the present disclosure; fig. 2 is a timing diagram of a local communication algorithm supporting a full platform provided in an embodiment of the present disclosure. As shown in fig. 1 and 2, the local communication flow supporting the full platform includes the following steps:
Step 101, initializing a local file, which is used as a carrier file to carry communication data, and logically formatting the carrier file, where the carrier file includes a notification (notify) data area and a reply (reply) data area, where the notification data area is used to store the sent notification data, and the reply data area is used to store the reply data received back.
Step 102, a sender process of the system registers a change notification callback function of the carrier file, referred to as a first change notification callback function, for monitoring a response data area of the carrier file, and a receiver process of the system registers a change notification callback function of the carrier file, referred to as a second change notification callback function, for monitoring a notification data area of the carrier file.
Step 103, when the sender process needs to send data to the receiver process, the sender process sends the data to the receiver process through an event (event) sending interface, the sender process writes the data as notification data into a notification data area of the carrier file, and distributes a sending event ID and a message ID (notify 1).
And 104, after the second change notification callback function of the receiver process receives the notification, the receiver process receives data from the second change notification callback function through a notification (notify) receiving interface, and the receiving process of the notification data is completed after the upper layer application processing logic.
If the sender process sends the data of notify2, notify3, and the like, the data is received at the same time.
Step 105, when the response of the receiving process returns, the receiving process writes the response data into the response data area of the carrier file through the response (reply) interface, and allocates the corresponding response event ID and message ID (reply 1).
When a plurality of replies are returned, a plurality of pieces of reply data, such as reply2, reply3, etc., are formed and written into the reply data area.
Step 106, after the first change notification callback function of the sender process receives the notification, the sender process receives data from the first change notification callback function through an event (event) sending interface, and the receiving process of the response data is completed after the data is processed through the upper application processing logic.
If the response data is a plurality of pieces, the response data is also received at the same time.
Step 107, according to the sending event ID and the corresponding response event ID, the response data may be fed back to the task logic corresponding to the notification data.
The above embodiment solves such a problem: because of the characteristics of the file change notification interface of the system, when one data is sent, the receiving process can repeatedly receive the data for a plurality of times, and the same data repeated for a plurality of times can cause data confusion and cannot meet the normal and stable data communication. In order to solve the problem, the embodiment performs logical data formatting on the data in the carrier file, so that each communication data has a unique event ID and message ID, and thus the current communication event action can be obtained, and the corresponding communication data content can be obtained, thereby avoiding the problem of multiple identical data reception caused by repeated notification.
Another technical problem is also solved: because the data stored in the file cannot be communicated in two directions in normal use, that is, the receiving process cannot return response data after receiving the data, a common method is to re-establish a file carrier, and the sending process and the receiving process register a set of change notification callback functions to make response data callback communication logic, so that the code logic is inserted into the two sets of communication logic to make mutual calling and sending and response data matching judgment, the code logic becomes extremely complex, mismatching of the sending and response data is easy to cause, and the problem of common communication data confusion in communication is solved. In this embodiment, all the sending data and the response data can be saved by using only one carrier file, and one-to-one correspondence can be achieved. In the embodiment, notification data (notify) and response data (reply) are divided into two logic areas in a carrier file, the notification data is stored in the notification data area, the response data is stored in the response data area, event IDs (notify 1, reply2 and.+ -.) of the notification data are in one-to-one correspondence with event IDs (notify 1, reply2 and.+ -.) of the response data, so that bidirectional communication logic of a sender process and a receiver process in communication is realized through single carrier file storage data, and codes are logically divided into clear sending thread logic to store the notification data and receive the response data, and receiving thread logic to store the response data and receive the notification data.
In another embodiment of the present invention, the event transmission interface has a synchronous interface and an asynchronous transmission interface that block a transmission state, and the synchronous interface returns only when receiving a response, and returns response data; and the asynchronous sending interface returns after sending data, no response data is returned at the moment, and the callback function is notified through the first change to acquire the response data of the receiver process.
In another embodiment of the present invention, the carrier file is logically formatted into a honeycomb-like structure for supporting data insertion into the carrier file during concurrent communication, thereby supporting the problem of collisions that may occur when inserting data into a save file during a large number of transmit and receive tasks in data communication, which collisions may result in one data being saved while another data being saved in the same file being overwritten, resulting in loss of communication data (similar to packet loss for network communication). The structure of the carrier file in the embodiment ensures that data insertion and storage can be efficiently realized under the condition of sending a large amount of communication data, a large amount of response data can be returned immediately, and unordered response return of the data is supported.
In another embodiment of the invention, the carrier file comprises a plurality of carrier files for multi-channel communication. Therefore, multi-channel communication can be realized, a plurality of carrier files are established through a plurality of initialization operations, one carrier file corresponds to one communication channel, and the mode is similar to the establishment of a plurality of sockets in network communication, occupies different network ports and realizes communication with different servers.
A system for implementing the above-described local communication flow is described below.
Fig. 3 is a schematic structural diagram of a local communication system supporting a full platform according to an embodiment of the present disclosure. As shown in fig. 3, the local communication system supporting the full platform includes a carrier file unit 31, a sender process unit 32, a receiver process unit 33, an event transmission interface unit 34, a notification reception interface unit 35, a response interface unit 36, and a task logic unit 37.
The carrier file unit further comprises an initialization module 311, a formatting module 312, a notification data module 313 and a response data module 314. The initialization module is used for initializing the local file, the local file is used as a carrier file, the formatting module is used for logically formatting the carrier file, the notification data module is used for storing the sent notification data, and the response data module is used for storing the response data received back.
The sender process unit is used for registering a first change notification callback function of the carrier file, monitoring a response data module, sending notification data through the event sending interface unit, writing the notification data module, distributing a sending event ID and a message ID, receiving data from the first change notification callback function through the event sending interface unit after the first change notification callback function receives the notification, and completing receiving processing of the response data after passing through the upper application processing logic.
The receiving process unit is used for registering a second change notification callback function of the carrier file, monitoring a notification data module, receiving data from the second change notification callback function through the notification receiving interface unit after the second change notification callback function receives the notification, completing receiving processing of the notification data after the notification receiving interface unit passes through the upper layer application processing logic, and writing response data into the response data module through the response interface unit when the response is returned, and distributing corresponding response event IDs and message IDs.
The task logic unit is used for feeding back response data to task logic corresponding to the notification data according to the sending event ID and the corresponding response event ID.
The event transmission interface unit has a synchronous interface module 341 and an asynchronous transmission interface module 342 for blocking a transmission state, and the synchronous interface module is used for returning only when receiving a response and returning response data; the asynchronous sending interface module is used for sending data and returning the data, and the response data of the receiving side process is obtained through the first change notification callback function without returning the response data.
The carrier file elements are logically formatted in a honeycomb-like structure for supporting data insertion into the carrier file during concurrent communications. Therefore, the problem of conflict caused by inserting data into a storage file when a large number of transmitting and receiving tasks in data communication is supported, and the conflict can cause that one piece of data can cover another piece of data stored in the same file at the same time when the file is stored, so that communication data is lost (similar to packet loss of network communication). The structure of the carrier file in the embodiment ensures that data insertion and storage can be efficiently realized under the condition of sending a large amount of communication data, a large amount of response data can be returned immediately, and unordered response return of the data is supported.
The carrier file unit may comprise a plurality of carrier file units for multi-channel communication. Therefore, multi-channel communication can be realized, a plurality of carrier files are established through a plurality of initialization operations, one carrier file corresponds to one communication channel, and the mode is similar to the establishment of a plurality of sockets in network communication, occupies different network ports and realizes communication with different servers.
The embodiment of the disclosure also provides an electronic device, which comprises:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the platform-wide local communication method of the foregoing method embodiments.
Fig. 4 is a schematic diagram of an electronic device according to an embodiment of the disclosure. As shown in fig. 4, a schematic diagram of an electronic device 40 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 4, the electronic device 40 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 401, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage means 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 40 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
In general, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, magnetic tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device 40 to communicate with other devices wirelessly or by wire to exchange data. While an electronic device 40 having various means is shown in the figures, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communications device 409, or from storage 408, or from ROM 402. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 401.
The disclosed embodiments also provide a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the local communication method supporting full platform in the foregoing method embodiments.
The disclosed embodiments also provide a computer program product comprising a computer program which, when executed by a processor, implements the platform-wide local communication method of the foregoing method embodiments.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects an internet protocol address from the at least two internet protocol addresses and returns the internet protocol address; receiving an Internet protocol address returned by the node evaluation equipment; wherein the acquired internet protocol address indicates an edge node in the content distribution network.
Or the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
The foregoing is merely specific embodiments of the disclosure, but the protection scope of the disclosure is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the disclosure are intended to be covered by the protection scope of the disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A method of local communication, comprising the steps of:
Initializing a local file as a carrier file;
logically formatting the carrier file, wherein the carrier file comprises a notification data area and a response data area, the notification data area is used for storing sent notification data, and the response data area is used for storing response data received back;
the sender process registers a first change notification callback function of the carrier file, which is used for monitoring a response data area of the carrier file, and the receiver process registers a second change notification callback function of the carrier file, which is used for monitoring a notification data area of the carrier file;
When the sender process sends data to the receiver process through an event sending interface, the sender process takes the data as notification data, writes the notification data into a notification data area of the carrier file, and distributes a sending event ID and a message ID;
after the second change notification callback function receives the notification, the receiver process receives data from the second change notification callback function through a notification receiving interface, and completes the receiving processing of the notification data after passing through upper-layer application processing logic;
when the receiving process responds back, writing response data into a response data area of the carrier file through a response interface, and distributing corresponding response event ID and message ID;
After the first change notification callback function receives the notification, the sender process receives data from the first change notification callback function through an event sending interface, and completes receiving processing of the response data after upper-layer application processing logic;
And feeding back response data to task logic corresponding to the notification data according to the sending event ID and the corresponding response event ID.
2. The local communication method according to claim 1, wherein the event transmission interface has a synchronous interface and an asynchronous transmission interface which block a transmission state, the synchronous interface returning only when receiving a response, and returning response data; and the asynchronous sending interface returns after sending data, no response data is returned at the moment, and the callback function is informed to acquire the response data of the receiver process through the first change.
3. The local communication method of claim 1, wherein the carrier file is logically formatted in a honeycomb-like structure for supporting data insertion into the carrier file during concurrent communication.
4. The local communication method according to claim 1, wherein the carrier file includes not less than two carrier files for multi-channel communication.
5. A local communication system is characterized by comprising a carrier file unit, a sender process unit, a receiver process unit, an event sending interface unit, a notification receiving interface unit, a response interface unit and a task logic unit, wherein the carrier file unit further comprises an initialization module, a formatting module, a notification data module and a response data module,
The initialization module is used for initializing a local file as a carrier file;
The formatting module is used for logically formatting the carrier file;
the notification data module is used for storing the sent notification data;
The response data module is used for storing and receiving the returned response data;
The sender process unit is used for registering a first change notification callback function of the carrier file, monitoring the response data module, sending notification data through the event sending interface unit, writing the notification data module, distributing and sending event ID and message ID, receiving data from the first change notification callback function through the event sending interface unit after the first change notification callback function receives the notification, and completing receiving processing of the response data through upper application processing logic;
The receiving process unit is used for registering a second change notification callback function of the carrier file, monitoring the notification data module, receiving data from the second change notification callback function through the notification receiving interface unit after the second change notification callback function receives the notification, completing receiving processing of the notification data after upper-layer application processing logic, and writing response data into the response data module through the response interface unit when response is returned, and distributing corresponding response event ID and message ID;
And the task logic unit is used for feeding back response data to task logic corresponding to the notification data according to the sending event ID and the corresponding response event ID.
6. The local communication system according to claim 5, wherein the carrier file unit comprises no less than two carrier file units for multi-channel communication;
The event transmission interface unit is provided with a synchronous interface module and an asynchronous transmission interface module which block the transmission state, and the synchronous interface module is used for returning only when receiving a response and returning response data; the asynchronous sending interface module is used for sending data and returning the data, and the response data of the receiver process is obtained through the first change notification callback function without returning the response data.
7. The local communication system of claim 5, wherein the carrier file unit is logically formatted in a honeycomb-like structure for supporting data insertion into a carrier file during concurrent communication.
8. An electronic device, comprising:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor, which when executed by the at least one processor, cause the at least one processor to perform the local communication method of any of claims 1 to 5.
9. A non-transitory computer-readable storage medium storing computer instructions that, when executed by at least one processor, cause the at least one processor to perform the local communication method of any of claims 1-5.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 5.
CN202410260936.1A 2024-03-07 2024-03-07 Local communication method, system, equipment, storage medium and product Pending CN118132289A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410260936.1A CN118132289A (en) 2024-03-07 2024-03-07 Local communication method, system, equipment, storage medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410260936.1A CN118132289A (en) 2024-03-07 2024-03-07 Local communication method, system, equipment, storage medium and product

Publications (1)

Publication Number Publication Date
CN118132289A true CN118132289A (en) 2024-06-04

Family

ID=91245804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410260936.1A Pending CN118132289A (en) 2024-03-07 2024-03-07 Local communication method, system, equipment, storage medium and product

Country Status (1)

Country Link
CN (1) CN118132289A (en)

Similar Documents

Publication Publication Date Title
CN110275723A (en) Obtain method, apparatus, electronic equipment and the readable medium of resource
CN110377369B (en) Method, device and computer storage medium for running small program
CN111400172B (en) Program debugging method and device
CN114625481A (en) Data processing method and device, readable medium and electronic equipment
CN114089920A (en) Data storage method and device, readable medium and electronic equipment
CN109218393B (en) Push implementation method, device, equipment and computer storage medium
CN111596991A (en) Interactive operation execution method and device and electronic equipment
CN116774933A (en) Virtualization processing method of storage device, bridging device, system and medium
CN111273985A (en) Page rendering method and device, electronic equipment and computer readable storage medium
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
CN115237589A (en) SR-IOV-based virtualization method, device and equipment
CN112306685B (en) Task isolation method, device, electronic equipment and computer readable medium
CN111596992B (en) Navigation bar display method and device and electronic equipment
CN109981778B (en) Method, device, equipment and storage medium for realizing service of content distribution network
CN111309406A (en) Event processing method and device of application program and electronic equipment
CN113518183B (en) Camera calling method and device and electronic equipment
CN118132289A (en) Local communication method, system, equipment, storage medium and product
CN111625326B (en) Task pipeline execution method and device and electronic equipment
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN110083283B (en) Method, device and system for managing information
CN114490104A (en) Information forwarding method, device, equipment and medium in Android system module
CN113783830B (en) Method and apparatus for data communication
CN112688863B (en) Gateway data processing method and device and electronic equipment
CN117749739B (en) Data transmission method, data reception method, device, equipment and storage medium
CN115114051B (en) Node communication method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination