Man-machine environment data processing method, edge computing device and system and storage medium

The shared memory-based method for inter-process communication addresses RPC inefficiencies by directly communicating within the same machine, ensuring efficient and secure data exchange.

CN119225998APending Publication Date: 2024-12-31KINGFAR INTERNATIONAL INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411178516.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

Existing remote procedure call (RPC) mechanisms face inefficiencies and delays in inter-process communication on the same machine due to network overhead and instability, leading to performance issues and resource consumption.

Method used

A human-computer environment data processing method utilizing a shared memory for inter-process communication, where processes write and read messages directly from a shared memory, reducing communication delays and resource consumption.

Benefits of technology

Enables efficient and reliable inter-process communication on the same machine, minimizing communication delays and resource usage while enhancing security by eliminating network-related risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119225998A_ABST
    Figure CN119225998A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a man-machine environment data processing method, an edge computing device and system and a storage medium, in the man-machine environment data processing method, a first process writes a first message into a first memory, and reads a second message from the first memory after detecting that the second message is written into the first memory, obtaining a message type and a method identifier carried by the second message, and when the value of the message type carried by the second message is a response and the method identifier carried by the second message is matched with the identifier of the method requested to be called by the first process, determining the second message as a response message of the first message by the first process, and then the first process processes the second message, so that efficient and reliable inter-process communication can be realized on the same machine, and communication delay and resource consumption can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a human-machine environment data processing method, an edge computing device and system, and a storage medium. Background Art

[0002] Currently, common remote procedure call (RPC) mechanisms mainly rely on network communication, such as hypertext transfer protocol (HTTP) and / or transmission control protocol (TCP), etc. However, these methods have certain overhead and latency issues when communicating between processes on the same machine.

[0003] Network calls inevitably introduce delays, especially in cross-region or cross-network environments. This delay may significantly affect the response time and performance of the system, making the communication efficiency of RPC calls low. In addition, the instability of the network environment may cause problems such as request loss, delay or timeout, so RPC calls need to handle various network failures, such as: network disconnection, packet loss and / or network congestion. Summary of the invention

[0004] The embodiments of the present application provide a human-computer environment data processing method, an edge computing device and system, and a storage medium to achieve efficient inter-process communication on the same machine and reduce communication delays and resource consumption.

[0005] In a first aspect, an embodiment of the present application provides a method for processing human-computer environment data, comprising: a first process writes a first message into a first memory; wherein the first message carries a message type and a method identifier, and the method identifier includes an identifier of a method requested to be called by the first process; the first memory is a shared memory between the first process and the second process, and is used for human-computer environment data processing between the first process and the second process; after the first process detects that the second message is written into the first memory, the second message is read from the first memory to obtain the message type and method identifier carried by the second message; wherein the second message is written into the first memory after the second process executes the method indicated by the method identifier carried by the first message; the second process executes the method indicated by the method identifier carried by the first message after detecting that the first message is written into the first memory, determining that the value of the message type carried by the first message is a request, and the second process is capable of executing the method indicated by the method identifier carried by the first message; when the value of the message type carried by the second message is a response, and the method identifier carried by the second message matches the identifier of the method requested to be called by the first process, the first process determines that the second message is a response message of the first message; and the first process processes the second message.

[0006] In one possible implementation, the first process includes a process created when the human-computer environment synchronization platform is started or a process created when a request sent by the human-computer environment synchronization platform is received, and the second process includes a process created when the application center is started; the first message is a permission acquisition request message, and the human-computer environment synchronization platform uses the permission acquisition request message to obtain permission from the application center; wherein the permission includes application center access permission and / or human-computer environment data processing permission; or,

[0007] The first process includes the process created when the target application is started, and the second process includes the process created when the human-computer environment synchronization platform is started or the process created when a request sent by the human-computer environment synchronization platform is received; the method identifier carried in the first message includes a method identifier instructing the second process to execute human-computer environment data acquisition control, and the acquisition control includes at least one of the following: starting acquisition, stopping acquisition, filtering or noise reduction preprocessing of the acquired data, and extracting specified features from the acquired data.

[0008] In one possible implementation, the human-machine environment data includes human-related data, machine-related data, human-machine interaction-related data, and environment-related data;

[0009] The human body related data includes one or a combination of the following: skin electrical skin temperature data, pulse data, blood pressure data, blood oxygen data, electrocardiogram data, electromyography data, muscle oxygen data, respiratory data, biomechanical data, near-infrared brain imaging data, electroencephalography data, transcranial stimulation data, heart rate variability data, heart rate data, image / video data, sound data, eye movement data, gesture or action data;

[0010] The machine-related data includes one or a combination of the following: machine operation data, fault alarm data, machine control data, machine model data, machine communication data, and machine positioning data;

[0011] The human-computer interaction related data includes one or a combination of the following: human-computer voice interaction data, human-computer text interaction data, human-computer touch interaction data, human-computer gesture or action interaction data, human-computer EEG interaction data, human-computer eye movement interaction data, and human-computer expression interaction data;

[0012] The environment-related data includes one or a combination of the following: location data, humidity data, temperature data, chromaticity data, brightness data, weather data, road condition data, traffic data, stimulus signal data, event or signal marking data.

[0013] In one possible implementation, after reading the second message from the first memory, it also includes: obtaining the XOR value of the second message carried by the second message; before the first process determines that the second message is a response message to the first message, it also includes: the first process determines that the XOR value of the second message is correct.

[0014] In one possible implementation, after the first process writes the first message to the first memory, the process also includes: the first process releases the mutual exclusion lock between the first process and the second process; then the second process detects that the first message is written into the first memory, including: the second process detects that the mutual exclusion lock between the first process and the second process is released, and determines that the first message is written into the first memory.

[0015] In the above-mentioned human-computer environment data processing method, the first process writes the first message into the first memory, and after detecting that the second message is written into the above-mentioned first memory, the second message is read from the first memory to obtain the message type and method identifier carried by the second message. When the value of the message type carried by the second message is a response, and the method identifier carried by the above-mentioned second message matches the identifier of the method requested to be called by the first process, the first process determines that the second message is a response message of the first message, and then the first process processes the above-mentioned second message, thereby realizing efficient and reliable inter-process communication on the same machine, and reducing communication delays and resource consumption.

[0016] In one possible implementation manner, before the first process writes the first message into the first memory, the method further includes: after the first process is started, when a shared memory has not been created between the first process and the second process, creating the first memory.

[0017] In one possible implementation manner, after creating the first memory, the method further includes: the first process creates two buffers in the first memory, and designates one of the two buffers as a currently used buffer.

[0018] In one possible implementation, the first process writing the first message into the first memory includes: the first process checking whether the currently used buffer has any free storage space; if the currently used buffer has any free storage space, the first process writing the first message into the currently used buffer.

[0019] In one possible implementation, after the first process checks whether the currently used buffer has any free storage space, it also includes: if the currently used buffer has no free storage space, marking the currently used buffer as full and switching to a backup buffer, where the backup buffer is a buffer of the two buffers other than the currently used buffer.

[0020] In one possible implementation, reading the second message from the first memory includes: checking whether the second message exists in the buffer currently in use; if so, reading the second message from the buffer currently in use; if the second message does not exist in the buffer currently in use, reading the second message from a backup buffer, the backup buffer being a buffer of the two buffers other than the buffer currently in use.

[0021] In one possible implementation, after creating the first memory, it also includes: the first process creates a buffer array in the first memory and initializes a read pointer and a write pointer; the initial positions of the read pointer and the write pointer are the starting positions of the buffer array.

[0022] In one possible implementation, the first process writes the first message to the first memory, including: the first process checks the position pointed to by the write pointer; if the next position of the position pointed to by the write pointer is not the read pointer, writing the first message to the position pointed to by the write pointer.

[0023] In one possible implementation, reading the second message from the first memory includes: the first process checking the position pointed to by the read pointer; if the position pointed to by the read pointer is different from the position pointed to by the write pointer, reading the second message from the position pointed to by the read pointer.

[0024] In one possible implementation, the first message and the second message use the same message format, the message format includes a message header and a message body, the message header includes the message type and the method identifier, the message header also includes the XOR value of the message, a frame identifier and the length of the message content; and / or, the second process is a process that is already running of the target program, and the first process is a process created for the current startup of the target program; the message body of the first message carries startup parameters for the current startup of the target program.

[0025] In a second aspect, an embodiment of the present application provides an edge computing device, comprising: one or more processors; a memory; multiple applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the edge computing device, enable the edge computing device to execute the method provided in the first aspect.

[0026] In one possible implementation, the edge computing device also includes: a human-computer environment data acquisition unit, used to collect human-computer environment data; and / or a human-computer environment data acquisition interface unit, used to connect to the human-computer environment data acquisition unit to obtain human-computer environment data.

[0027] In a third aspect, an embodiment of the present application provides an edge computing system, including: a human-computer environment synchronization platform and an edge computing device provided in the second aspect, wherein the edge computing device communicates with the human-computer environment synchronization platform and sends processing results to the human-computer environment synchronization platform.

[0028] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method provided in the first aspect.

[0029] In a fifth aspect, an embodiment of the present application provides a computer program, which, when executed by a computer, is used to execute the method provided in the first aspect.

[0030] In one possible design, the program in the fifth aspect may be stored in whole or in part on a storage medium packaged together with the processor, or may be stored in whole or in part on a memory not packaged together with the processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A schematic diagram of the structure of an edge computing device provided for one embodiment of the present application;

[0032] Figure 2 A flowchart of a method for processing human-machine environment data provided by one embodiment of the present application;

[0033] Figure 3 A schematic diagram of inter-process communication provided for one embodiment of the present application;

[0034] Figure 4 A schematic diagram of the format of a message header provided for one embodiment of the present application;

[0035] Figure 5 A flowchart of a method for processing human-machine environment data provided by another embodiment of the present application;

[0036] Figure 6 A flowchart of a method for processing human-machine environment data provided by yet another embodiment of the present application;

[0037] Figure 7 A schematic diagram of the structure of an edge computing device provided in another embodiment of the present application;

[0038] Figure 8 A schematic diagram of the structure of an edge computing system provided for one embodiment of the present application. DETAILED DESCRIPTION

[0039] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0040] Based on the problem of low efficiency of inter-process communication of the RPC mechanism on the same machine in the existing related technology, an embodiment of the present application provides a human-computer environment data processing method, which can achieve efficient and reliable inter-process communication on the same machine, and can also reduce communication delays and resource consumption.

[0041] The human-machine environment data processing method provided in the embodiment of the present application can be applied to edge computing devices, wherein the above-mentioned edge computing devices can be personal computers (personal computers, PCs), smart phones, smart watches, tablet computers, wearable devices, eye trackers, EEG / biomechanical / biological signal acquisition equipment, smart sensors, vehicle-mounted equipment, augmented reality (augmented reality, AR) / virtual reality technology (virtual reality, VR) equipment, laptops or ultra-mobile personal computers (ultra-mobile personal computers, UMPCs) and other devices; the embodiment of the present application does not impose any restrictions on the specific type of edge computing devices.

[0042] For example, Figure 1 A schematic diagram of the structure of an edge computing device provided in one embodiment of the present application is shown in FIG. Figure 1 As shown, the edge computing device 100 may include one or more processors 110; a memory 130; multiple applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory 130, and the one or more computer programs include instructions. When the above instructions are executed by the edge computing device 100, the edge computing device 100 can execute the human-computer environment data processing method provided in an embodiment of the present application.

[0043] In addition, the edge computing device 100 may further include a communication interface 120. The processor 110, the communication interface 120 and the memory 130 may communicate with each other through an internal connection path to transmit control and / or data signals.

[0044] The processor 110 and the memory 130 may be combined into a processing device, or more commonly, they are independent components, and the processor 110 is used to execute program codes stored in the memory 130. In specific implementation, the memory 130 may also be integrated into the processor 110, or may be independent of the processor 110.

[0045] In addition, in order to make the functions of the edge computing device 100 more complete, the edge computing device 100 may also include one or more of an input unit 160, a human-machine environment data acquisition interface unit 150, and a human-machine environment data acquisition unit 170.

[0046] Wherein, the human-machine environment data collection unit 170 is used to collect human-machine environment data; and / or,

[0047] The human-machine environment data acquisition interface unit 150 is used to connect to the human-machine environment data acquisition unit 170 to acquire human-machine environment data.

[0048] It should be understood that Figure 1 The processor 110 in the edge computing device 100 shown may be a system on chip SOC, and the processor 110 may include a central processing unit (CPU), and may further include other types of processors, such as a graphics processing unit (GPU), etc.

[0049] For ease of understanding, the following embodiments of the present application will be described in detail with Figure 1 Taking the edge computing device of the shown structure as an example, the human-computer environment data processing method provided by the embodiment of the present application is specifically explained in combination with the accompanying drawings and application scenarios.

[0050] Figure 2 A flowchart of a method for processing human-machine environment data provided by an embodiment of the present application is shown in FIG. Figure 2 As shown, the above-mentioned human-machine environment data processing method may include:

[0051] Step 201: A first process writes a first message into a first memory.

[0052] Among them, the above-mentioned first message carries a message type and a method identifier, the above-mentioned method identifier includes the identifier of the method requested to be called by the first process, and the above-mentioned first memory is a shared memory between the first process and the second process, which is used for human-computer environment data communication between the first process and the second process.

[0053] Step 202: After the first process detects that the second message is written into the first memory, the first process reads the second message from the first memory to obtain the message type and method identifier carried by the second message.

[0054] Among them, the second message is written to the first memory after the second process executes the method indicated by the method identifier carried by the first message; the second process executes the method indicated by the method identifier carried by the first message after detecting that the first message is written into the first memory, determining that the value of the message type carried by the first message is a request, and the second process is capable of executing the method indicated by the method identifier carried by the above-mentioned first message.

[0055] It can be seen from this step that both the first process and the second process can access the first memory, that is, the first memory is a shared memory between the first process and the second process, and is used to store human-computer environment data between the first process and the second process.

[0056] It should be noted that, in this embodiment, the first process and the second process run on the same edge computing device 100, that is, the communication between the first process and the second process occurs on the same edge computing device 100, thereby reducing the security risks brought by network communication (for example: data leakage and / or man-in-the-middle attacks, etc.).

[0057] Step 203: When the value of the message type carried by the second message is response, and the method identifier carried by the second message matches the identifier of the method requested to be called by the first process, the first process determines that the second message is a response message to the first message.

[0058] Among them, the method identifier carried by the above-mentioned second message matches the identifier of the method requested to be called by the first process, which can be: the method identifier carried by the above-mentioned second message is the same as the identifier of the method requested to be called by the first process, or the method identifier carried by the above-mentioned second message corresponds to the identifier of the method requested to be called by the first process.

[0059] In some examples, after reading the second message from the first memory, the first process can also obtain the XOR value of the second message carried by the second message; thus, before the first process determines that the second message is a response message to the first message, the first process can also first determine that the XOR value of the second message is correct. That is, in these examples, when the value of the message type carried by the second message is a response, the method identifier carried by the second message matches the identifier of the method requested to be called by the first process, and the first process determines that the XOR value of the second message is correct, the first process determines that the second message is a response message to the first message.

[0060] Step 204: The first process processes the second message.

[0061] In the above-mentioned human-computer environment data processing method, the first process writes the first message into the first memory, and after detecting that the second message is written into the above-mentioned first memory, the second message is read from the first memory to obtain the message type and method identifier carried by the second message. When the value of the message type carried by the second message is a response, and the method identifier carried by the above-mentioned second message matches the identifier of the method requested to be called by the first process, the first process determines that the second message is a response message of the first message, and then the first process processes the above-mentioned second message, thereby realizing efficient and reliable inter-process communication on the same machine, and reducing communication delays and resource consumption.

[0062] The following is a specific example of this application Figure 2 The human-machine environment data processing method provided by the illustrated embodiment is described.

[0063] In the human-machine environment data processing method provided by the embodiment of the present application, a shared memory is created between every two processes for processing the human-machine environment data between the two processes and storing the human-machine environment data between every two processes. In addition, for the above-mentioned shared memory, a memory pool management technology can be used to dynamically allocate and recycle memory to improve memory utilization.

[0064] Figure 3 A schematic diagram of inter-process communication provided by an embodiment of the present application. Figure 3 As shown in the figure, after process A is started, if there is no shared memory between process A and process B, process A can create memory 1 for communication with process B; here process A is equivalent to the first process, process B is equivalent to the second process, and memory 1 is equivalent to the first memory. If there is a shared memory between process A and process B after process A is started, the shared memory is the first memory, and process A does not need to create it again.

[0065] When process A needs to call process B, process A can write a first message to memory 1. The first message carries a message type (FrameType) and a method identifier (MethodID), and may also carry an exclusive OR value (Xor), a frame identifier (FrameID) and the length of the message content (PayloadLength); wherein the value of the message type carried in the first message is request, the exclusive OR value is the exclusive OR value of the first message, the method identifier is the identifier of the method requested to be called by process A, and FrameID is a sequence ID used to identify the sequence of the first message.

[0066] After process B detects that a message is written to memory 1, it reads the first message from memory 1. If process B determines that the value of the message type carried by the first message is a request, the second process is capable of executing the method indicated by the method identifier carried by the first message, and the XOR value of the first message is correct, then process B executes the method indicated by the method identifier carried by the first message. After process B executes the above method, it writes the second message to memory 1. Similarly, the second message carries the message type and method identifier. In addition, the second message may also carry the XOR value, frame identifier, and the length of the message content. Among them, the value of the message type carried by the second message is response.

[0067] After process A detects that a message is written in memory 1, it reads the second message from memory 1 and obtains the message type and method identifier carried by the second message. When the value of the message type carried by the second message is a response, the method identifier carried by the second message matches the identifier of the method requested to be called by process A, and process A determines that the XOR value of the second message is correct, process A determines that the second message is a response message to the first message, and then process A can process the second message.

[0068] The above description is illustrated by taking process A calling process B as an example. The process of process B calling process A is similar and will not be repeated here.

[0069] It can be seen from the description of the above embodiment that the first message and the second message adopt the same message format, and the above message format includes a message header and a message body. Figure 4 A schematic diagram of the format of a message header provided for an embodiment of the present application is shown in FIG. Figure 4 As shown, the message header includes the message type and method identifier, and the message header may also include the XOR value of the message, a frame identifier, and the length of the message content.

[0070] Wherein, the value of message type can be request or response;

[0071] The XOR value is the XOR value of the entire message;

[0072] The method id is the identifier of the method;

[0073] The frame identifier is a sequence identifier used to identify the order of messages. The value of the frame identifier is incremented in the form of an atomic operation.

[0074] This application Figure 2 In the illustrated embodiment, a first memory is created between the first process and the second process for RPC communication between the first process and the second process. In specific implementation, a mutex mechanism can be used to achieve inter-process synchronization to ensure concurrent access security of the shared memory. Specifically, this application Figure 2 In the illustrated embodiment, after step 201, the first process may also release the mutual exclusion lock between the first process and the second process; in this way, the second process detecting that the first message is written into the first memory may be: the second process detects that the mutual exclusion lock between the first process and the second process is released, and determines that the first message is written into the first memory.

[0075] Similarly, in step 202, after the second process writes the second message into the first memory, the mutex lock between the first process and the second process is released. Thus, the first process detects that the mutex lock between the first process and the second process is released and can determine that the first message is written into the first memory.

[0076] Figure 5A flowchart of a method for processing human-machine environment data provided by another embodiment of the present application is shown in FIG. Figure 5 As shown, this application Figure 2 In the illustrated embodiment, before step 201, the following steps may also be included:

[0077] Step 501: After the first process is started, if a shared memory has not been created between the first process and the second process, the first process creates a first memory.

[0078] It should be noted that, if a shared memory has been created between the first process and the second process after the first process is started, the first process does not need to create it again, and the created shared memory is the first memory.

[0079] Step 502: The first process creates two buffers in the first memory, and designates one of the two buffers as a currently used buffer.

[0080] Thus, step 201 may include:

[0081] Step 503, the first process checks whether the currently used buffer has any free storage space. If the currently used buffer has any free storage space, step 504 is executed; if the currently used buffer has no free storage space, steps 505 to 506 are executed.

[0082] Step 504: The first process writes the first message into the currently used buffer, and then executes step 507.

[0083] Step 505: mark the currently used buffer as full, and switch to use the standby buffer, where the standby buffer is the buffer other than the currently used buffer among the two buffers.

[0084] Step 506: The first process writes the first message into the standby buffer. Then, step 507 is executed.

[0085] Step 202 may include:

[0086] Step 507: After the first process detects that the second message is written into the first memory, it checks whether there is the second message in the currently used buffer. If there is, step 508 is executed; if there is no second message in the currently used buffer, step 509 is executed.

[0087] Step 508: The first process reads the second message from the currently used buffer, obtains the message type and method identifier carried by the second message, and then executes step 203.

[0088] Step 509: the first process reads the second message from the backup buffer, obtains the message type and method identifier carried by the second message, and then executes step 203.

[0089] This embodiment uses two buffers to alternately perform data read and write operations, which can improve data processing efficiency and system response speed; and when one buffer is writing data, the other buffer can perform data read operations. The read and write operations are performed alternately, which can ensure the continuity and efficiency of data processing.

[0090] Figure 6 A flowchart of a method for processing human-machine environment data provided by another embodiment of the present application is shown in FIG. Figure 6 As shown, this application Figure 2 In the illustrated embodiment, before step 201, the following steps may also be included:

[0091] Step 601: After the first process is started, if a shared memory has not been created between the first process and the second process, the first process creates a first memory.

[0092] It should be noted that, if a shared memory has been created between the first process and the second process after the first process is started, the first process does not need to create it again, and the created shared memory is the first memory.

[0093] Step 602: The first process creates a buffer array in the first memory and initializes a read pointer and a write pointer.

[0094] The initial positions of the read pointer and the write pointer are the starting positions of the buffer array, which is equivalent to creating a ring buffer in the first memory. The ring buffer is a first-in first-out (FIFO) data structure, where the buffers are connected from beginning to end to form a ring structure, which is suitable for continuous data stream processing.

[0095] Thus, step 201 may include:

[0096] Step 603: The first process checks the position pointed to by the write pointer.

[0097] Step 604: If the next position of the position pointed to by the write pointer is not the read pointer, the first process writes the first message to the position pointed to by the write pointer.

[0098] Specifically, if the next position of the position pointed by the write pointer is the read pointer, it means that the buffer is full and it is necessary to wait or discard the data. In addition, after the first process writes the first message to the position pointed by the write pointer, it is necessary to move the write pointer to the next position. After each write operation, the write pointer needs to be moved to the next position until the loop reaches the starting position of the buffer array.

[0099] Step 202 may include:

[0100] Step 605: After the first process detects that the second message is written into the first memory, it checks the position pointed to by the read pointer.

[0101] Step 606: If the position pointed to by the read pointer is different from the position pointed to by the write pointer, the first process reads the second message from the position pointed to by the read pointer to obtain the message type and method identifier carried by the second message. Then, step 203 is executed.

[0102] Specifically, if the position pointed to by the read pointer is the same as the position pointed to by the write pointer, it means that the buffer is empty and it is necessary to wait or perform other operations.

[0103] In addition, after the first process reads the second message from the position indicated by the read pointer, the read pointer needs to be moved to the next position. After each read operation, the read pointer needs to be moved to the next position until the loop reaches the starting position of the buffer array.

[0104] In this embodiment, a circular buffer is used to optimize read and write operations and reduce blocking. Since the circular buffer is connected end to end, the management of the write pointer and the read pointer needs to pay attention to the boundary conditions, and the modulus operation (mod) can be used to process the pointer loop.

[0105] The human-machine environment data processing method provided by the embodiment of the present application uses a shared memory to realize inter-process communication. Since data is directly read and written in the shared memory, the communication delay is very low, which is suitable for application scenarios with extremely high response time requirements. In addition, since data transmission is completed in the memory, it does not need to pass through the network, thereby avoiding the overhead of network communication (such as TCP / IP protocol stack processing) and reducing the use of system resources, such as CPU and memory consumption. In addition, shared memory provides extremely high bandwidth, which can transmit large-scale data without being limited by bandwidth like network transmission.

[0106] In addition, in the human-machine environment data processing method provided by the embodiment of the present application, the human-machine environment data communication occurs on the same machine, reducing the security risks brought by network communication, such as data leakage and man-in-the-middle attacks, and only needs to manage the access control and permissions between processes in the local system. In addition, the embodiment of the present application provides an error detection mechanism, which can detect data transmission errors by frame identification (FrameID). For example, assuming that the frame identification of the first message is 1, the frame identification of the second message should be 2, so that if the frame identification of the second message read by the first process from the first memory is 3, the data transmission error can be determined. After detecting the data transmission error, the embodiment of the present application also provides an error recovery mechanism, including retry, rollback and / or log recording, etc., so as to ensure the reliability of communication.

[0107] In the human-machine environment data processing method provided by the embodiment of the present application, since the human-machine environment data communication occurs on the same machine, it is a local communication, so the developer does not need to deal with the complexity of network communication, such as connection management, data packet processing and / or network protocol, thereby simplifying the coding and debugging work. In addition, the embodiment of the present application provides a concise application programming interface (API) interface for users to conveniently call RPC functions.

[0108] The following introduces the application scenarios of the human-machine environment data processing method provided by the embodiments of the present application.

[0109] Scenario 1:

[0110] The human-computer environment data processing method provided in the embodiment of the present application can be applied to the singleton mode startup scenario of the target program, wherein the singleton mode means that the target program can only be run once. If the target program is started and it is found that the target program is already running, the process created by the target program at this startup can adopt the method of the present application. Figure 2 to Figure 6 The method provided by the illustrated embodiment sends startup parameters to the already running process of the target program and then exits automatically.

[0111] In this scenario, the process of the target program that is already running can be regarded as the second process, the process created by the target program when it is started this time can be regarded as the first process, and the message body of the first message carries the startup parameters of the target program when it is started this time.

[0112] Scenario 2:

[0113] The human-machine environment data processing method provided in the embodiment of the present application can be applied in the permission control scenario of the application center (App Center). For example, the human-machine environment synchronization platform can adopt the present application. Figure 2 to Figure 6 The method provided in the illustrated embodiment obtains permissions from the application center.

[0114] In this scenario, the first process can be a process created when the human-machine environment synchronization platform is started or a process created when a request sent by the human-machine environment synchronization platform is received. The second process can be a process created when the application center is started. The first message is a permission acquisition request message. The human-machine environment synchronization platform uses the permission acquisition request message to obtain permissions from the application center. The permissions may include application center access permissions and / or human-machine environment data processing permissions. The process of the human-machine environment synchronization platform obtaining permissions from the application center can be found in Figure 2 to Figure 6 The description of the illustrated embodiment will not be repeated here.

[0115] Scenario 3:

[0116] The human-computer environment data processing method provided in the embodiment of the present application can be applied to a scenario in which a target application (eg, a questionnaire scale) requests a human-computer environment synchronization platform to collect and / or process human-computer environment data.

[0117] In this scenario, the first process may be a process created when the target application (for example, a questionnaire scale) is started, and the second process may be a process created when the human-computer environment synchronization platform is started or a process created when a request sent by the human-computer environment synchronization platform is received; the method identifier carried in the above-mentioned first message may include a method identifier instructing the second process to execute human-computer environment data acquisition control, and the above-mentioned acquisition control may include at least one of the following: starting acquisition, stopping acquisition, filtering or noise reduction preprocessing of the acquired data, and performing specified feature extraction on the acquired data.

[0118] The human-machine environment data mentioned in the embodiments of the present application may include human-related data, machine-related data, human-machine interaction-related data, and environment-related data;

[0119] The human body related data includes one or a combination of the following: skin electrical temperature data, pulse data, blood pressure data, blood oxygen data, electrocardiogram data, electromyography data, muscle oxygen data, respiratory data, biomechanical data, near-infrared brain imaging data, electroencephalography data, transcranial stimulation data, heart rate variability data, heart rate data, image / video data, sound data, eye movement data, gesture or action data;

[0120] The above-mentioned machine-related data includes one or a combination of the following: machine operation data, fault alarm data, machine control data, machine model data, machine communication data, and machine positioning data;

[0121] The above-mentioned human-computer interaction related data includes one or a combination of the following: human-computer voice interaction data, human-computer text interaction data, human-computer touch interaction data, human-computer gesture or action interaction data, human-computer EEG interaction data, human-computer eye movement interaction data, and human-computer expression interaction data;

[0122] The above-mentioned environment-related data includes one or a combination of the following: location data, humidity data, temperature data, chromaticity data, brightness data, weather data, road condition data, traffic data, stimulus signal data, event or signal marking data.

[0123] The above data is not a complete list of various data that need to be obtained for human factors and ergonomics analysis. The above human-machine environment data may also include other data, and this embodiment does not limit the above human-machine environment data.

[0124] It is to be understood that some or all of the steps or operations in the above embodiments are merely examples, and the present application embodiments may also perform other operations or variations of various operations. In addition, the various steps may be performed in different orders presented in the above embodiments, and it is possible that not all of the operations in the above embodiments need to be performed.

[0125] It is understandable that in order to implement the above functions, the edge computing device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of this application.

[0126] This embodiment can divide the functional modules of the edge computing device according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0127] Figure 7 A schematic diagram of the structure of an edge computing device provided in another embodiment of the present application, in which each functional module is divided according to each function, Figure 7 A possible schematic diagram of the composition of the edge computing device 700 involved in the above embodiment is shown, as shown in FIG. Figure 7 As shown, the edge computing device 700 may include: a receiving unit 701, a processing unit 702 and a sending unit 703;

[0128] Among them, the processing unit 702 can be used to support the edge computing device 700 to execute steps 201 to 204, steps 501 to 509, steps 601 to 606, etc., and / or other processes of the technical solution described in the embodiments of the present application.

[0129] This application Figure 2 to Figure 6 All relevant contents of each step involved in the illustrated method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0130] The edge computing device 700 provided in this embodiment is used to execute the application Figure 2 to Figure 6 The human-machine environment data processing method provided by the illustrated embodiment can therefore achieve the same effect as the above method.

[0131] It should be understood that the edge computing device 700 may correspond to Figure 1 The edge computing device 100 shown in FIG. The functions of the receiving unit 701 and the sending unit 703 can be Figure 1 The edge computing device 100 shown in FIG. 1 is implemented by the processor 110 and the communication interface 120; the function of the processing unit 702 can be implemented by Figure 1 The processor 110 in the edge computing device 100 is shown implemented.

[0132] In the case of an integrated unit, the edge computing device 700 may include a processing module, a storage module, and a communication module.

[0133] The processing module can be used to control and manage the actions of the edge computing device 700. For example, it can be used to support the edge computing device 700 to execute the steps performed by the above-mentioned receiving unit 701, processing unit 702 and sending unit 703. The storage module can be used to support the edge computing device 700 to store program codes and data, etc. The communication module can be used to support the communication between the edge computing device 700 and other devices.

[0134] Among them, the processing module can be a processor or a controller, which can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module can be a memory. The communication module can specifically be a device that interacts with other edge computing devices, such as a radio frequency circuit, a Bluetooth chip and / or a Wi-Fi chip.

[0135] In one embodiment, when the processing module is a processor and the storage module is a memory, the edge computing device 700 involved in this embodiment can be a Figure 1Device of the structure shown.

[0136] Figure 8 A schematic diagram of the structure of an edge computing system provided in one embodiment of the present application is shown in FIG. Figure 8 As shown, the above-mentioned edge computing system may include: a human-computer environment synchronization platform 801 and an edge computing device 802.

[0137] The above-mentioned edge computing device 802 communicates with the human-computer environment synchronization platform 801 and sends the processing result to the human-computer environment synchronization platform 802; wherein the above-mentioned processing result can be the processing result of the edge computing device 802 on the human-computer environment data.

[0138] In this embodiment, the edge computing device 802 may be a Figure 1 or Figure 7 Device of the structure shown.

[0139] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the present application. Figure 2 to Figure 6 The method provided by the illustrated embodiment.

[0140] The present application also provides a computer program product, which includes a computer program, which, when executed on a computer, enables the computer to execute the present application. Figure 2 to Figure 6 The method provided by the illustrated embodiment.

[0141] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0142] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0144] In several embodiments provided in the present application, any function can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0145] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for processing human-machine environment data, characterized in that: include: The first process writes a first message into a first memory; wherein the first message carries a message type and a method identifier, and the method identifier includes an identifier of a method requested to be called by the first process; the first memory is a shared memory between the first process and the second process, and is used for human-computer environment data processing between the first process and the second process; After the first process detects that the second message is written into the first memory, the second process reads the second message from the first memory to obtain the message type and method identifier carried by the second message; wherein the second message is written into the first memory after the second process executes the method indicated by the method identifier carried by the first message; the second process executes the method indicated by the method identifier carried by the first message after detecting that the first message is written into the first memory, determining that the value of the message type carried by the first message is a request, and the second process is capable of executing the method indicated by the method identifier carried by the first message; When the value of the message type carried by the second message is response, and the method identifier carried by the second message matches the identifier of the method requested to be called by the first process, the first process determines that the second message is a response message to the first message; The first process processes the second message.

2. The method according to claim 1, characterized in that The first process includes a process created when the human-computer environment synchronization platform is started or a process created when a request sent by the human-computer environment synchronization platform is received, and the second process includes a process created when the application center is started; the first message is a permission acquisition request message, and the human-computer environment synchronization platform uses the permission acquisition request message to obtain permission from the application center; wherein the permission includes application center access permission and / or human-computer environment data processing permission; or, The first process includes the process created when the target application is started, and the second process includes the process created when the human-computer environment synchronization platform is started or the process created when a request sent by the human-computer environment synchronization platform is received; the method identifier carried in the first message includes a method identifier instructing the second process to execute human-computer environment data acquisition control, and the acquisition control includes at least one of the following: starting acquisition, stopping acquisition, filtering or noise reduction preprocessing of the acquired data, and extracting specified features from the acquired data.

3. The method according to claim 1, characterized in that The human-machine environment data includes human-related data, machine-related data, human-machine interaction-related data, and environment-related data; The human body related data includes one or a combination of the following: skin electrical skin temperature data, pulse data, blood pressure data, blood oxygen data, electrocardiogram data, electromyography data, muscle oxygen data, respiratory data, biomechanical data, near-infrared brain imaging data, electroencephalography data, transcranial stimulation data, heart rate variability data, heart rate data, image / video data, sound data, eye movement data, gesture or action data; The machine-related data includes one or a combination of the following: machine operation data, fault alarm data, machine control data, machine model data, machine communication data, and machine positioning data; The human-computer interaction related data includes one or a combination of the following: human-computer voice interaction data, human-computer text interaction data, human-computer touch interaction data, human-computer gesture or action interaction data, human-computer EEG interaction data, human-computer eye movement interaction data, and human-computer expression interaction data; The environment-related data includes one or a combination of the following: location data, humidity data, temperature data, chromaticity data, brightness data, weather data, road condition data, traffic data, stimulus signal data, event or signal marking data.

4. The method according to claim 1, characterized in that After reading the second message from the first memory, the method further includes: Obtaining an exclusive OR value of the second message carried by the second message; Before the first process determines that the second message is a response message to the first message, the process further includes: The first process determines that the XOR value of the second message is correct.

5. The method according to claim 1, characterized in that: After the first process writes the first message into the first memory, the process further includes: The first process releases the mutual exclusion lock between the first process and the second process; Then the second process detecting that the first message is written into the first memory includes: the second process detecting that the mutual exclusion lock between the first process and the second process is released, and determining that the first message is written into the first memory.

6. The method according to any one of claims 1 to 5, characterized in that: Before the first process writes the first message into the first memory, the process further includes: After the first process is started, if a shared memory has not been created between the first process and the second process, the first memory is created.

7. The method according to claim 6, characterized in that After the first memory is created, the method further includes: The first process creates two buffers in the first memory, and designates one of the two buffers as a currently used buffer.

8. The method according to claim 7, characterized in that The first process writing the first message into the first memory includes: The first process checks whether there is any free storage space in the currently used buffer; If the currently used buffer has free storage space, the first process writes the first message into the currently used buffer.

9. The method according to claim 8, characterized in that After the first process checks whether there is any free storage space in the currently used buffer, it further includes: If the currently used buffer has no free storage space, the currently used buffer is marked as full, and the standby buffer is switched to be used, where the standby buffer is the buffer other than the currently used buffer among the two buffers.

10. The method according to claim 7, characterized in that The reading the second message from the first memory comprises: Check whether there is the second message in the currently used buffer; If yes, read the second message from the currently used buffer; If the second message does not exist in the currently used buffer, the second message is read from a spare buffer, where the spare buffer is a buffer of the two buffers other than the currently used buffer.

11. The method according to claim 6, characterized in that After the first memory is created, the method further includes: The first process creates a buffer array in the first memory and initializes a read pointer and a write pointer; the initial positions of the read pointer and the write pointer are the starting positions of the buffer array.

12. The method according to claim 11, characterized in that The first process writing the first message into the first memory includes: The first process checks the position pointed to by the write pointer; If the next position of the position pointed to by the write pointer is not the read pointer, the first message is written to the position pointed to by the write pointer.

13. The method according to claim 11, characterized in that The reading the second message from the first memory comprises: The first process checks the position pointed to by the read pointer; If the position pointed to by the read pointer is different from the position pointed to by the write pointer, the second message is read from the position pointed to by the read pointer.

14. The method according to any one of claims 1 to 5, characterized in that: The first message and the second message use the same message format, the message format includes a message header and a message body, the message header includes the message type and the method identifier, the message header also includes the XOR value of the message, a frame identifier and the length of the message content; and / or, The second process is a process of the target program that has been running, and the first process is a process created by the target program when it is started this time; the message body of the first message carries startup parameters for the target program when it is started this time.

15. An edge computing device, characterized in that: include: one or more processors; Memory; Multiple applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the edge computing device, enable the edge computing device to perform the method as described in any one of claims 1-14.

16. The edge computing device according to claim 15, characterized in that: Also includes: A human-machine environment data collection unit, used to collect human-machine environment data; and / or, The human-machine environment data acquisition interface unit is used to connect to the human-machine environment data acquisition unit to obtain the human-machine environment data.

17. An edge computing system, characterized in that: include: A human-computer environment synchronization platform and an edge computing device as described in claim 15 or 16, wherein the edge computing device communicates with the human-computer environment synchronization platform and sends processing results to the human-computer environment synchronization platform.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 14.