Communication method based on edge server, edge server and storage medium
By obtaining process requirements information in the edge server and dynamically configuring the IPC communication mechanism, the problems of low communication efficiency, collaboration complexity and language compatibility in the edge server are solved, and efficient and reliable data transmission and system stability are achieved between processes.
Patent Information
- Application Number
- CN202510538581.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-08
AI Technical Summary
In the edge servers in the charging networking system, there are problems such as inefficient communication between services, easy blockage, complex multi-service collaboration, conflicts with task scheduling and language compatibility, resulting in a decline in system performance and increasing development and maintenance difficulties.
By obtaining the requirements information of multiple processes running in the edge server, dynamically determine the corresponding IPC communication mechanism for each process, and establish a communication connection, including exception process detection, whitelist verification, shared memory and synchronization mechanism, asynchronous communication mechanism, etc., to ensure efficient and reliable data transmission between processes.
It improves the overall operation efficiency of edge servers, reduces inter-process communication errors and conflicts, enhances the stability and reliability of the system, and supports efficient data transmission locally and remotely.
Smart Images

Figure CN120448156A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer communication technology, and in particular to a communication method based on an edge server, an edge server, and a storage medium. Background Art
[0002] The following technical problems exist in the edge servers of the charging networking system: First, the communication efficiency and congestion problems between services are significant, resulting in slow data transmission speed, affecting the overall performance of the system and service response time; second, multi-service collaboration is complex and highly coupled, which increases the difficulty of development and maintenance, while reducing the flexibility and independence of services; third, there is a conflict between real-time requirements and task scheduling, and the existing scheduling mechanism cannot effectively guarantee the timely processing of critical tasks; finally, the compatibility issues of services implemented in different languages are prominent, and the lack of unified communication standards or middleware makes service integration and interoperability in a multi-language environment difficult. Summary of the Invention
[0003] One purpose of an embodiment of the present invention is to provide a communication method based on an edge server, an edge server, and a storage medium, which are used to solve technical problems in communication efficiency, collaboration complexity, real-time guarantee, and language compatibility between multiple services in the edge server.
[0004] In a first aspect, an embodiment of the present invention provides an edge server-based communication method, which is applied to an edge server. The method includes:
[0005] Obtaining multiple processes running in the edge server and demand information corresponding to each of the multiple processes;
[0006] Determine the IPC communication mechanism corresponding to each process according to the demand information corresponding to each process;
[0007] According to the IPC communication mechanism corresponding to each process, a communication connection is established between the multiple processes to enable data transmission between the multiple processes.
[0008] In combination with the first aspect, in a possible implementation, before determining the IPC communication mechanism corresponding to each process based on the demand information corresponding to each process, the method also includes: detecting the running status of each process; in response to detecting that the running status of any process is a termination state, marking the process corresponding to the termination state as an abnormal process; removing the abnormal process, and evaluating the communication requirements of other processes except the abnormal process to obtain the demand values corresponding to the other processes except the abnormal process; when the demand value is greater than the preset demand value, obtaining the demand information corresponding to other processes greater than the preset demand value.
[0009] It can be seen that in this embodiment, the edge server can monitor the process status in real time, promptly detect and handle abnormal processes, and evaluate the communication needs of the remaining processes, thereby ensuring the effective use of system resources and efficient collaboration between processes.
[0010] In combination with the first aspect, in a possible implementation method, determining the IPC communication mechanism corresponding to each process based on the demand information corresponding to each process includes: parsing the demand information corresponding to each process, and determining the communication requirements in the demand information corresponding to each process; if the communication requirements are in a preset first communication requirement list, determining that the IPC communication mechanism corresponding to each process is a first communication mechanism, and the first communication mechanism is used for asynchronous communication between each process; or, if the communication requirements are in a preset second communication requirement list, determining that the IPC communication mechanism corresponding to each process is a second communication mechanism, and the second communication mechanism is a shared memory mechanism.
[0011] It can be seen that in this embodiment, the edge server can intelligently select and configure the most appropriate IPC communication mechanism according to the specific communication requirements of each process, thereby achieving efficient and reliable inter-process communication and collaboration.
[0012] In combination with the first aspect, in a possible implementation method, after determining that the IPC communication mechanism corresponding to each process is the first communication mechanism, a communication connection is established between the multiple processes according to the IPC communication mechanism corresponding to each process, so that data is transmitted between the multiple processes, including creating an initial message queue according to the first communication mechanism; setting properties of the initial message queue according to the demand information corresponding to each process to generate a target message queue, and the target message queue includes the property information of each process; and establishing a communication connection between the multiple processes according to the target message queue, so that data is transmitted between the multiple processes.
[0013] It can be seen that in this embodiment, an efficient and reliable asynchronous communication mechanism can be established according to the specific requirements of each process, thereby realizing flexible data transmission and collaboration between multiple processes.
[0014] In combination with the first aspect, in a possible implementation method, after determining that the IPC communication mechanism corresponding to each process is the second communication mechanism, establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process, so that data is transmitted between the multiple processes, including: in each process, allocating a preset shared memory area, the preset shared memory area is used to store data transmitted between processes; in the preset shared memory area, setting a synchronization mechanism; according to the synchronization mechanism and the preset shared memory area, data is transmitted between the multiple processes.
[0015] It can be seen that in this embodiment, through the combination of shared memory and synchronization mechanism, the edge server can achieve fast and efficient data transmission between multiple processes.
[0016] In combination with the first aspect, in a possible implementation, before establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, the method also includes: obtaining identification information corresponding to each process; detecting whether the identification information corresponding to each process is within a preset whitelist; if so, verifying that it is successful, and establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes; or, if not, eliminating the processes that are not within the preset whitelist to obtain multiple first processes within the preset whitelist; and establishing a communication connection between the multiple first processes according to the IPC communication mechanism corresponding to each first process so that data is transmitted between the multiple first processes.
[0017] It can be seen that in this embodiment, by introducing identification information verification and whitelist filtering, the edge server can effectively control the communication permissions between processes, prevent unauthorized processes from participating in data transmission, improve security and stability, and avoid potential security risks and data leakage.
[0018] In combination with the first aspect, in a possible implementation method, after establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, the method also includes: establishing a communication connection between each process and the cloud server according to a preset network protocol and the IPC communication mechanism corresponding to each process.
[0019] It can be seen that in this embodiment, by combining the preset network protocol and IPC communication mechanism, the edge server can achieve efficient communication between the process and the cloud server, not only supporting fast data exchange between local processes, but also extending to remote communication across networks, so that distributed applications can run smoothly in the cloud environment.
[0020] In combination with the first aspect, in a possible implementation, after establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, the method also includes: detecting a second process and the demand information of the second process; evaluating the demand information of the second process to obtain the IPC communication mechanism corresponding to the second process; dynamically adjusting the target IPC communication mechanism of all processes in the edge server according to the IPC communication mechanism corresponding to the second process; and establishing a communication connection between all the processes according to the target IPC communication mechanism so that data is transmitted between all the processes.
[0021] It can be seen that in this embodiment, by detecting process requirements and dynamically adjusting the communication mechanism, the edge server can achieve efficient inter-process communication in the edge server environment, improve the speed and reliability of data transmission, and enable edge computing to flexibly respond to different application scenarios and load conditions.
[0022] In a second aspect, an embodiment of the present invention provides an edge server-based communication device, which is applied to an edge server, and the device includes:
[0023] an acquiring unit, configured to acquire a plurality of processes running in the edge server and demand information corresponding to each of the plurality of processes;
[0024] a determining unit, configured to determine an IPC communication mechanism corresponding to each process according to the requirement information corresponding to each process;
[0025] The communication unit is used to establish a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process, so as to enable data transmission between the multiple processes.
[0026] In a third aspect, an edge server is provided, comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is configured to execute one or more computer programs stored in the memory. When the processor executes the one or more computer programs, the edge server implements the edge server-based communication method as described in the first aspect.
[0027] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the edge server-based communication method as described in the first aspect.
[0028] In the embodiment implemented by the above-mentioned edge server-based communication method, device, edge server and storage medium, the plurality of processes running in the edge server and the demand information corresponding to each of the plurality of processes are first obtained; secondly, the IPC communication mechanism corresponding to each process is determined based on the demand information corresponding to each process; finally, a communication connection is established between the plurality of processes based on the IPC communication mechanism corresponding to each process, so that data can be transmitted between the plurality of processes. This embodiment can more accurately allocate communication resources, avoid resource waste, and improve the overall operating efficiency of the edge server by obtaining the demand information of each process in the edge server; select the appropriate IPC communication mechanism according to the specific needs of the process, ensure that each process can communicate in the most suitable manner, adapt to different application scenarios and demand changes; establish appropriate communication connections between the plurality of processes, ensure that data can be transmitted quickly and stably between the processes, reduce delays, and improve system response speed; therefore, this solution reduces inter-process communication errors and conflicts through reasonable IPC mechanism selection and communication connection establishment, and improves the stability and reliability within the edge server. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0030] Figure 1 This is a schematic diagram of a charging networking system according to an embodiment of the present invention;
[0031] Figure 2 This is a flow chart of a communication method based on an edge server in one embodiment of the present invention;
[0032] Figure 3 1 is a schematic structural diagram of a communication device based on an edge server in one embodiment of the present invention;
[0033] Figure 4 FIG. 1 is a schematic diagram of the structure of an edge server in one embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0035] It should be noted that, unless there is a conflict, the various features of the embodiments of the present invention may be combined with each other and are all within the scope of protection of the present invention. In addition, although the functional modules are divided in the device schematics and the logical order is shown in the flow charts, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flow charts. Furthermore, the terms "first," "second," "third," etc. used in the present invention do not limit the data or execution order, but only distinguish between identical or similar items with substantially the same functions and effects.
[0036] See also Figure 1 , Figure 1 This is a schematic diagram of a charging networking system provided in an embodiment of the present application, wherein the charging networking system 10 includes a cloud server 20, a southbound device 30 and an edge server 40.
[0037] Among them, the charging networking system 10 ensures that edge computing devices can be quickly accessed in any local area network and provides stable and reliable services for southbound devices.
[0038] Cloud server 20 is responsible for collecting and analyzing data from edge servers, performing data analysis, decision-making, and remote control. It also stores and processes charging data from southbound devices 30, optimizing and monitoring the charging process. Communication between cloud server 20 and edge server 40 ensures intelligent control and optimization of the entire system.
[0039] Southbound device 30 is a front-end device in the charging network system, such as a charging station. It interacts directly with users and is responsible for collecting charging requirements and device status information. Southbound device 30 is connected to the local area network via Ethernet or Wi-Fi, and its IP address is dynamically assigned by the DNSMASQ service of edge server 40.
[0040] The edge server 40 is a computing device deployed at the edge of the network near data sources (such as charging stations). It is used to process local data, provide fast responses, and reduce the burden on the cloud server 20. The edge server 40 typically contains multiple services or processes (such as data collection services, task scheduling services, cache services, logging services, etc.), which communicate and collaborate with each other.
[0041] Through the above solution, the charging networking system realizes the rapid networking of edge servers, efficient communication of southbound devices, and the intelligent and stable operation of the overall system.
[0042] In view of this, this application proposes a communication method based on an edge server to solve the above problems, which is described in detail below.
[0043] See also Figure 2 , Figure 2 A flow chart of a communication method based on an edge server provided in an embodiment of the present invention, which is applied to an edge server, includes the following steps:
[0044] S10: Acquire multiple processes running in the edge server and demand information corresponding to each of the multiple processes.
[0045] A process is an independently running program instance in a computer, each with its own memory space and resources. When each process is started on an edge server, it is allocated specific resources (CPU, memory, etc.) and executes tasks according to a preset instruction set.
[0046] The demand information refers to the detailed information such as the specific resources, services or communication mechanisms required by each process during its operation, such as data transmission rate, processing power, memory requirements, etc.
[0047] Specifically, the acquisition process can be to detect and collect information of multiple running processes in real time through built-in monitoring and management tools of the edge server.
[0048] In specific implementation, after the edge server is started, its built-in monitoring tool starts running to monitor all processes on the edge server in real time. The monitoring tool obtains basic information such as the ID, status, resource usage, etc. of each process through system calls or API interfaces.
[0049] Optionally, the edge server integrates the collected basic process information and demand information to form a complete process information list, which includes detailed information such as the ID, name, status, resource usage, required service type, and data transmission requirements of each process.
[0050] It can be seen that in this embodiment, the edge server can accurately and in real time obtain multiple running processes and their corresponding demand information, providing basic data support for subsequent inter-process communication and collaboration.
[0051] S20. Determine an IPC communication mechanism corresponding to each process according to the requirement information corresponding to each process.
[0052] Among them, the IPC communication mechanism (Inter-Process Communication Mechanism) is the inter-process communication mechanism, which refers to the technology and method used in the operating system to allow data exchange and signal transmission between different processes.
[0053] Specifically, IPC communication mechanisms may include, but are not limited to, message queues, shared memory, signals, pipes, and sockets. Message queues are suitable for scenarios requiring reliable message delivery, especially when small data blocks need to be transferred in an orderly manner between processes. Shared memory is suitable for scenarios requiring fast transfer of large data blocks, enabling the sharing of a memory area between processes to improve transfer efficiency. Signals are suitable for scenarios requiring simple notifications or interruptions and are used for asynchronous communication between processes. Pipes are suitable for the transmission of linear data streams and are typically used for communication between parent and child processes.
[0054] Specifically, the demand information of each process is analyzed in detail, including the characteristics of data transmission (such as frequency, size, type, etc.), real-time requirements, security requirements, etc. For example, for processes that require high-speed data transmission, high-speed communication mechanisms such as shared memory or RDMA may be given priority; for processes that require high reliability, mechanisms such as message queues or pipes may be selected; based on the results of the demand analysis, the available IPC communication mechanisms are evaluated, and the evaluation content includes the transmission rate, reliability, complexity, resource usage, etc. of the communication mechanism. For example, although shared memory has a high transmission rate, a synchronization mechanism is required to avoid data conflicts; message queues have high reliability but may introduce additional delays; based on the results of the demand analysis and mechanism evaluation, a suitable IPC communication mechanism is developed for each process.
[0055] It can be seen that this embodiment can determine and implement the most appropriate IPC communication mechanism for each process, thereby ensuring efficient and reliable communication between processes and meeting the needs of various application scenarios.
[0056] S30. Establish a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process, so as to enable data transmission between the multiple processes.
[0057] A communication connection is a data transmission path established between different processes, allowing them to exchange information and collaborate. The establishment of a connection depends on the selected IPC mechanism.
[0058] Data transmission refers to the information exchange process over an established communication connection, which involves sending, receiving, and processing data.
[0059] In the specific implementation, the IPC communication mechanism determined by each process is parsed to understand its working principle, configuration requirements and usage methods. For example, for shared memory, it is necessary to determine the size of the memory area, access permissions, etc.; for message queues, it is necessary to determine the name of the queue, the maximum message size, etc.; based on the parsing results, the required communication resources are allocated to each process, including memory space, network ports, file descriptors, etc.; using the allocated resources, according to the requirements of the IPC communication mechanism, a communication channel is created between processes. For example, for pipes, it is necessary to create a pipe file and set read and write permissions; for sockets, it is necessary to create a socket pair and bind the port; after the communication channel is created, a connection is established between the processes; after the connection is established, the process needs to prepare for data transmission, such as setting the transmission mode, data format, etc. For example, for shared memory, it is necessary to agree on the read and write location and synchronization mechanism of the data; for message queues, it is necessary to define the structure and type of the message; the process transmits data in a standardized format through the established communication connection; when the data transmission is completed, the process needs to properly terminate the communication connection and release the occupied resources.
[0060] It can be seen that in this embodiment, by establishing an effective communication connection, the edge server can support efficient data transmission between multiple processes, thereby realizing complex computing tasks and service delivery.
[0061] This embodiment obtains the demand information of each process in the edge server, which can allocate communication resources more accurately, avoid resource waste, and improve the overall operating efficiency of the edge server; selects the appropriate IPC communication mechanism according to the specific needs of the process to ensure that each process can communicate in the most suitable manner to adapt to different application scenarios and changes in demand; establishes appropriate communication connections between multiple processes to ensure that data can be transmitted quickly and stably between processes, reduce delays, and improve system response speed; therefore, this solution reduces inter-process communication errors and conflicts through reasonable IPC mechanism selection and communication connection establishment, and improves the stability and reliability within the edge server.
[0062] In one embodiment, before determining the IPC communication mechanism corresponding to each process based on the demand information corresponding to each process, the method further includes: detecting the running status of each process; in response to detecting that the running status of any process is a terminated state, marking the process corresponding to the terminated state as an abnormal process; removing the abnormal process, and evaluating the communication requirements of other processes except the abnormal process to obtain demand values corresponding to the other processes except the abnormal process; when the demand value is greater than a preset demand value, obtaining demand information corresponding to other processes greater than the preset demand value.
[0063] The running state refers to the current state of a process in the operating system, which may include but is not limited to running, waiting, paused, and terminated states. The edge server monitors the state of each process periodically or in real time to identify whether the process is running normally.
[0064] The terminated state refers to a state in which the process has finished executing and no longer occupies system resources.
[0065] An abnormal process is a process that is in a terminated state, which may be terminated due to an error, failure, or other reasons. Once a process is detected in a terminated state, it is immediately marked as abnormal for subsequent processing.
[0066] Specifically, removing abnormal processes means excluding processes marked as abnormal from the currently active process list. This means cleaning and updating the process list to ensure that only normally running processes remain. The removal operation may involve updating the process list and releasing resources.
[0067] The communication demand assessment is an evaluation of the communication needs of the remaining normally operating processes. The assessment may be based on historical data, real-time data, or a forecasting model, and factors such as data transmission volume, transmission rate, and real-time requirements may be considered.
[0068] The demand value is a numerical value that quantifies the communication demand of a process and is used for comparison and judgment. The preset demand value is a pre-set threshold used to determine whether the communication demand of a process exceeds the normal range. The preset demand value is pre-set based on factors such as system resources and performance requirements.
[0069] The demand information corresponding to other processes that are greater than the preset demand value may include specific data transmission requirements, processing power requirements, memory requirements, etc.
[0070] It can be seen that in this embodiment, the edge server can monitor the process status in real time, promptly detect and handle abnormal processes, and evaluate the communication needs of the remaining processes, thereby ensuring the effective use of system resources and efficient collaboration between processes.
[0071] In one embodiment, determining the IPC communication mechanism corresponding to each process based on the demand information corresponding to each process includes: parsing the demand information corresponding to each process to determine the communication requirements in the demand information corresponding to each process; if the communication requirements are in a preset first communication requirement list, determining that the IPC communication mechanism corresponding to each process is a first communication mechanism, and the first communication mechanism is used for asynchronous communication between each process; or, if the communication requirements are in a preset second communication requirement list, determining that the IPC communication mechanism corresponding to each process is a second communication mechanism, and the second communication mechanism is a shared memory mechanism.
[0072] The parsing process may be to parse the demand information through parsing tools or algorithms to extract the communication demand portion.
[0073] Among them, communication requirements refer to the requirements of the process for data exchange during operation, including data volume, transmission frequency, real-time performance, etc.
[0074] The preset first communication requirement list is a set of predefined communication requirement standards, and processes that meet the standards will use the first communication mechanism.
[0075] The first communication mechanism is an IPC mechanism for asynchronous communication between processes, such as a message queue, a pipe, etc. The asynchronous communication mechanism allows processes to send and receive messages at different times without waiting for the response of the other party.
[0076] The preset second communication requirement list is another set of predefined communication requirement standards, and processes that meet the standards will use the second communication mechanism.
[0077] The second communication mechanism is a shared memory mechanism, which allows multiple processes to share a memory area, enabling efficient data exchange. It is suitable for scenarios that require fast transmission of large amounts of data.
[0078] In practice, each process's communication requirements are compared with a pre-defined requirements list to determine the required communication mechanism. Based on the matching results, the appropriate IPC mechanism is configured. For asynchronous communication, a message queue or event-driven system is configured. For shared memory, memory areas are allocated and synchronization measures are set up. Based on the determined IPC communication mechanism, the corresponding communication connection is established between the processes, and the processes begin data transmission and collaboration through the determined communication mechanism.
[0079] It can be seen that in this embodiment, the edge server can intelligently select and configure the most appropriate IPC communication mechanism according to the specific communication requirements of each process, thereby achieving efficient and reliable inter-process communication and collaboration.
[0080] In one embodiment, after determining that the IPC communication mechanism corresponding to each process is the first communication mechanism, establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, including: creating an initial message queue according to the first communication mechanism; setting properties of the initial message queue according to the demand information corresponding to each process to generate a target message queue, wherein the target message queue includes property information of each process; and establishing a communication connection between the multiple processes according to the target message queue so that data is transmitted between the multiple processes.
[0081] The message queue is an IPC mechanism provided by the operating system for passing messages between processes. The message queue can store multiple messages and supports asynchronous message delivery.
[0082] The initial message queue is the initial state when the message queue is created, and no specific attributes have been set. The creation process of the initial message queue can be created by calling the operating system API or using middleware to create one or more initial message queues.
[0083] Among them, the process of property setting is to configure the properties of the message queue according to the process's demand information, such as message size, queue length, permissions, etc.
[0084] The target message queue is a message queue with attributes set, which contains information and attributes that meet the needs of each process, such as process ID, permissions, message processing methods, etc.
[0085] Specifically, the target message queue is used to establish actual communication connections between multiple processes, and the target message queue is bound to each process, so that the process can send and receive messages through the message queue to achieve asynchronous data transmission.
[0086] In a specific implementation, after determining that the IPC communication mechanism corresponding to each process is the first communication mechanism, one or more initial message queues are created; the demand information of each process is parsed to extract the requirements related to the message queue, such as message size, processing speed, priority, etc.; according to these requirements, the attributes of the initial message queue are set, for example, a larger queue length and a higher priority are set for processes that require high-speed transmission; after the attributes are set, the initial message queue is converted into a target message queue, and the target message queue contains the attribute information of each process, such as process ID, authority, message processing method, etc.; according to the information of the target message queue, a communication connection is established between multiple processes within the edge server, and then data transmission is performed.
[0087] It can be seen that in this embodiment, an efficient and reliable asynchronous communication mechanism can be established according to the specific requirements of each process, thereby realizing flexible data transmission and collaboration between multiple processes.
[0088] In one embodiment, after determining that the IPC communication mechanism corresponding to each process is the second communication mechanism, establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process to enable data transmission between the multiple processes, including: in each process, allocating a preset shared memory area, the preset shared memory area is used to store data transmitted between processes; in the preset shared memory area, setting a synchronization mechanism; according to the synchronization mechanism and the preset shared memory area, enabling data transmission between the multiple processes.
[0089] A shared memory area is a section of memory allocated by the operating system that multiple processes can access simultaneously to exchange data. A pre-allocated shared memory area is a pre-allocated shared memory area whose size and location are determined during system design.
[0090] Among them, the synchronization mechanism is a mechanism that ensures that multiple processes do not conflict when accessing shared resources, such as mutex locks and semaphores.
[0091] In the process of data transmission between the multiple processes based on the synchronization mechanism and the preset shared memory area, when a process accesses the shared memory, it first performs a synchronization operation through a synchronization mechanism (such as a lock or semaphore) to ensure secure access. Then, the process can directly read and write data in the shared memory area. After completing the data operation, the process releases the synchronization mechanism to allow other processes to access the shared memory.
[0092] In specific implementation, when the edge server is started or the process is created, a preset shared memory area is allocated to each process. The shared memory area occupies a specific position in the physical memory and has a fixed size; the allocated shared memory area is initialized, such as clearing, setting initial data, etc.; a synchronization mechanism, such as a mutex, semaphore, etc., is set in the shared memory area; before accessing the shared memory area, the process must first obtain the corresponding synchronization mechanism (such as locking the mutex); after the access is completed, the synchronization mechanism is released (such as unlocking the mutex) to allow other processes to access; the process writes the data to be transmitted into the shared memory area, and other processes can obtain this data by reading the shared memory area. During the data transmission process, the synchronization mechanism ensures the consistency and integrity of the data.
[0093] It can be seen that in this embodiment, through the combination of shared memory and synchronization mechanism, the edge server can achieve fast and efficient data transmission between multiple processes.
[0094] In one embodiment, before establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, the method further includes: obtaining identification information corresponding to each process; detecting whether the identification information corresponding to each process is within a preset whitelist; if so, verifying that it is successful, and establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes; or, if not, eliminating processes that are not within the preset whitelist to obtain multiple first processes within the preset whitelist; and establishing a communication connection between the multiple first processes according to the IPC communication mechanism corresponding to each first process so that data is transmitted between the multiple first processes.
[0095] The identification information is specific information used to uniquely identify each process, and generally includes a process ID (PID), a process name, a user ID, and the like.
[0096] The acquisition process may be to extract identification information of each running process through a process management API of the operating system or other tools.
[0097] The preset whitelist is a predefined list that contains identification information of processes that are allowed to communicate. Only processes in the whitelist are allowed to communicate.
[0098] Verification passing means that the process's identification information is in the whitelist, allowing it to communicate. Removal means removing a process that is not in the whitelist, preventing it from participating in communication.
[0099] The first process is a process in a preset whitelist.
[0100] Specifically, if the identification information of the process is in the whitelist, it is marked as verified and allowed to participate in the subsequent communication connection establishment; if the identification information of the process is not in the whitelist, it is removed and only the process in the whitelist is retained as the first process for communication.
[0101] Furthermore, a communication connection is established between the processes according to the IPC communication mechanism corresponding to each verified process.
[0102] It can be seen that in this embodiment, by introducing identification information verification and whitelist filtering, the edge server can effectively control the communication permissions between processes, prevent unauthorized processes from participating in data transmission, improve security and stability, and avoid potential security risks and data leakage.
[0103] In one embodiment, after establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, the method further includes: establishing a communication connection between each process and the cloud server according to a preset network protocol and the IPC communication mechanism corresponding to each process.
[0104] The preset network protocol is a predefined set of rules and standards for network communication, such as TCP / IP, HTTP, MQTT, etc. The preset network protocol specifies the format, sequence, error handling, etc. of data transmission.
[0105] In specific implementation, according to the application scenario and network environment, a suitable preset network protocol is selected. For example, for applications with high real-time requirements, the TCP protocol can be selected; for applications with large data volumes, the UDP protocol can be selected; using the selected network protocol and IPC mechanism, a communication connection is established between the process and the cloud server, including steps such as establishing a network connection, configuring communication parameters, and performing identity authentication; when the communication connection is established, the process can transmit data with the cloud server, that is, the process sends data to the cloud server through the IPC mechanism, and the cloud server returns the result to the process after processing.
[0106] It can be seen that in this embodiment, by combining the preset network protocol and IPC communication mechanism, the edge server can achieve efficient communication between the process and the cloud server, not only supporting fast data exchange between local processes, but also extending to remote communication across networks, so that distributed applications can run smoothly in the cloud environment.
[0107] In one embodiment, after establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, the method further includes: detecting a second process and demand information of the second process; evaluating the demand information of the second process to obtain the IPC communication mechanism corresponding to the second process; dynamically adjusting the target IPC communication mechanism of all processes in the edge server according to the IPC communication mechanism corresponding to the second process; and establishing a communication connection between all the processes according to the target IPC communication mechanism so that data is transmitted between all the processes.
[0108] The second process refers to a process that is of particular concern or newly added in the edge server, and its demand information needs to be detected and evaluated.
[0109] Specifically, based on the second process's requirements, evaluate its communication speed, data volume, synchronization, and other requirements. Select an appropriate IPC mechanism. For example, if efficient data exchange is required, shared memory might be chosen; if asynchronous communication is required, a message queue might be chosen.
[0110] Dynamic adjustment refers to flexibly changing configurations to optimize performance based on real-time demand changes. The edge server analyzes the IPC requirements of the second process and determines whether the communication mechanisms of other processes need to be adjusted to maintain overall performance. If adjustments are necessary, the edge server reconfigures the inter-process communication mechanisms to ensure that all processes can adapt to the new communication requirements.
[0111] Among them, the target IPC communication mechanism is a unified communication method set for all processes after adjustment.
[0112] In specific implementations, connection parameters, such as shared memory size and message queue capacity, are configured based on the target IPC communication mechanism. Inter-process communication connections are established through system calls or middleware, enabling all processes to transmit data via the target IPC communication mechanism. Furthermore, during the communication process, connection status is continuously monitored to optimize transmission efficiency and address potential bottlenecks or failures.
[0113] It can be seen that in this embodiment, by detecting process requirements and dynamically adjusting the communication mechanism, the edge server can achieve efficient inter-process communication in the edge server environment, improve the speed and reliability of data transmission, and enable edge computing to flexibly respond to different application scenarios and load conditions.
[0114] It should be noted that, in each of the above-mentioned embodiments, there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of this application, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, or may be executed interchangeably, etc.
[0115] As another aspect of the embodiments of the present application, an edge server-based communication device is provided. The edge server-based communication device may be a software module comprising a plurality of instructions stored in a memory, and a processor may access the memory and invoke the instructions for execution to implement the edge server-based communication method described in each of the above embodiments.
[0116] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of a communication device based on an edge server provided by an embodiment of the present application. Figure 3 As shown, the edge server-based communication device 300 includes:
[0117] An acquiring unit 301 is configured to acquire multiple processes running in the edge server and demand information corresponding to each of the multiple processes;
[0118] A determining unit 302 is configured to determine an IPC communication mechanism corresponding to each process according to the requirement information corresponding to each process;
[0119] The communication unit 303 is configured to establish a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process, so as to enable data transmission between the multiple processes.
[0120] This embodiment obtains the demand information of each process in the edge server, which can allocate communication resources more accurately, avoid resource waste, and improve the overall operating efficiency of the edge server; selects the appropriate IPC communication mechanism according to the specific needs of the process to ensure that each process can communicate in the most suitable manner to adapt to different application scenarios and changes in demand; establishes appropriate communication connections between multiple processes to ensure that data can be transmitted quickly and stably between processes, reduce delays, and improve system response speed; therefore, this solution reduces inter-process communication errors and conflicts through reasonable IPC mechanism selection and communication connection establishment, and improves the stability and reliability within the edge server.
[0121] In one embodiment, before determining the IPC communication mechanism corresponding to each process based on the demand information corresponding to each process, the determination unit 302 is further used to: detect the running status of each process; in response to detecting that the running status of any process is a termination state, mark the process corresponding to the termination state as an abnormal process; remove the abnormal process, and evaluate the communication requirements of other processes except the abnormal process to obtain demand values corresponding to the other processes except the abnormal process; when the demand value is greater than a preset demand value, obtain demand information corresponding to other processes greater than the preset demand value.
[0122] In one embodiment, in determining the IPC communication mechanism corresponding to each process based on the requirement information corresponding to each process, the determination unit 302 is further used to: parse the requirement information corresponding to each process, and determine the communication requirement in the requirement information corresponding to each process; if the communication requirement is in a preset first communication requirement list, then determine that the IPC communication mechanism corresponding to each process is a first communication mechanism, and the first communication mechanism is used for asynchronous communication between each process; or, if the communication requirement is in a preset second communication requirement list, then determine that the IPC communication mechanism corresponding to each process is a second communication mechanism, and the second communication mechanism is a shared memory mechanism.
[0123] In one embodiment, after determining that the IPC communication mechanism corresponding to each process is the first communication mechanism, in establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, the communication unit 303 is also used to: create an initial message queue according to the first communication mechanism; set properties of the initial message queue according to the demand information corresponding to each process to generate a target message queue, and the target message queue includes the property information of each process; establish a communication connection between the multiple processes according to the target message queue so that data is transmitted between the multiple processes.
[0124] In one embodiment, after determining that the IPC communication mechanism corresponding to each process is the second communication mechanism, in establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, the communication unit 303 is also used to: in each process, allocate a preset shared memory area, and the preset shared memory area is used to store data transmitted between processes; in the preset shared memory area, set a synchronization mechanism; and according to the synchronization mechanism and the preset shared memory area, enable data transmission between the multiple processes.
[0125] In one embodiment, before establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, the communication unit 303 is further used to: obtain identification information corresponding to each process; detect whether the identification information corresponding to each process is within a preset whitelist; if so, verify that it is successful, and establish a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes; or, if not, eliminate the processes that are not within the preset whitelist to obtain multiple first processes within the preset whitelist; establish a communication connection between the multiple first processes according to the IPC communication mechanism corresponding to each first process so that data is transmitted between the multiple first processes.
[0126] In one embodiment, after establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, the communication unit 303 is also used to: establish a communication connection between each process and the cloud server according to the preset network protocol and the IPC communication mechanism corresponding to each process.
[0127] In one embodiment, after establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so that data is transmitted between the multiple processes, the communication unit 303 is also used to: detect a second process and demand information of the second process; evaluate the demand information of the second process to obtain the IPC communication mechanism corresponding to the second process; dynamically adjust the target IPC communication mechanism of all processes in the edge server according to the IPC communication mechanism corresponding to the second process; establish a communication connection between all processes according to the target IPC communication mechanism so that data is transmitted between all processes.
[0128] It should be noted that the aforementioned edge server-based communication device can execute the edge server-based communication method provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiments of the edge server-based communication device, please refer to the edge server-based communication method provided in the embodiments of this application.
[0129] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an edge server provided in an embodiment of the present application. Figure 4 As shown, the edge server 400 includes a processor 401 and a memory 402. The processor 401 is in communication with the memory 402.
[0130] The processor 401 is configured to support the edge server in executing the corresponding functions of the edge server-based communication method in the above-mentioned method embodiment. The processor 401 can be a central processing unit (CPU), a network processor (NP), a hardware chip, or any combination thereof. The above-mentioned hardware chip can be an application specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0131] Specifically, the processor 401 may include a sending card, a receiving card, and a driver chip.
[0132] Memory 402 is used to store program code, etc. Memory 402 may include volatile memory (VM), such as random access memory (RAM); non-volatile memory (NVM), such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); or a combination of the aforementioned types of memory.
[0133] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the edge server-based communication method as described in the aforementioned embodiment.
[0134] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0135] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A communication method based on an edge server, characterized in that: Applied to an edge server, the method includes: Obtaining multiple processes running in the edge server and demand information corresponding to each of the multiple processes; Determine the IPC communication mechanism corresponding to each process according to the demand information corresponding to each process; According to the IPC communication mechanism corresponding to each process, a communication connection is established between the multiple processes to enable data transmission between the multiple processes.
2. The method according to claim 1, characterized in that Before determining the IPC communication mechanism corresponding to each process according to the requirement information corresponding to each process, the method further includes: Detecting the running status of each process; In response to detecting that the running state of any process is a terminated state, marking the process corresponding to the terminated state as an abnormal process; Remove the abnormal process, and perform communication demand evaluation on the processes other than the abnormal process to obtain demand values corresponding to the processes other than the abnormal process; When the demand value is greater than a preset demand value, demand information corresponding to other processes whose demand value is greater than the preset demand value is obtained.
3. The method according to claim 1, characterized in that Determining the IPC communication mechanism corresponding to each process according to the requirement information corresponding to each process includes: Parsing the demand information corresponding to each process, and determining the communication demand in the demand information corresponding to each process; If the communication requirement is in the preset first communication requirement list, determining that the IPC communication mechanism corresponding to each process is the first communication mechanism, the first communication mechanism is used for asynchronous communication between each process; or If the communication requirement is in the preset second communication requirement list, it is determined that the IPC communication mechanism corresponding to each process is the second communication mechanism, and the second communication mechanism is a shared memory mechanism.
4. The method according to claim 3, characterized in that After determining that the IPC communication mechanism corresponding to each process is the first communication mechanism, establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process to enable data transmission between the multiple processes includes: Creating an initial message queue according to the first communication mechanism; According to the demand information corresponding to each process, the initial message queue is attributed and generated into a target message queue, wherein the target message queue includes the attribute information of each process; According to the target message queue, a communication connection is established between the multiple processes to enable data transmission between the multiple processes.
5. The method according to claim 3, characterized in that After determining that the IPC communication mechanism corresponding to each process is the second communication mechanism, establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process to enable data transmission between the multiple processes includes: In each of the processes, a preset shared memory area is allocated, where the preset shared memory area is used to store data transmitted between processes; In the preset shared memory area, setting a synchronization mechanism; According to the synchronization mechanism and the preset shared memory area, data is transmitted between the multiple processes.
6. The method according to claim 1, characterized in that Before establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so as to enable data transmission between the multiple processes, the method further includes: Obtaining identification information corresponding to each process; Detecting whether the identification information corresponding to each process is in a preset whitelist; If so, the verification is successful, and a communication connection is established between the multiple processes according to the IPC communication mechanism corresponding to each process, so that data is transmitted between the multiple processes; or, If not, the processes that are not in the preset whitelist are eliminated to obtain multiple first processes that are in the preset whitelist; According to the IPC communication mechanism corresponding to each first process, a communication connection is established between the multiple first processes, so that data is transmitted between the multiple first processes.
7. The method according to claim 1, characterized in that After establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so as to enable data transmission between the multiple processes, the method further includes: According to the preset network protocol and the IPC communication mechanism corresponding to each process, a communication connection is established between each process and the cloud server.
8. The method according to claim 1, characterized in that After establishing a communication connection between the multiple processes according to the IPC communication mechanism corresponding to each process so as to enable data transmission between the multiple processes, the method further includes: detecting a second process and demand information of the second process; Evaluate the requirement information of the second process and obtain an IPC communication mechanism corresponding to the second process; Dynamically adjust the target IPC communication mechanism of all processes in the edge server according to the IPC communication mechanism corresponding to the second process; According to the target IPC communication mechanism, a communication connection is established between all the processes to enable data transmission between all the processes.
9. An edge server comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is configured to execute one or more computer programs stored in the memory, wherein when the processor executes the one or more computer programs, the detection device implements the edge server-based communication method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the edge server-based communication method according to claims 1-8.