Data communication method, device and equipment of intelligent automobile operating system
By using shared memory mechanism in smart car operating systems, the problem of low data communication efficiency in microkernel operating systems is solved, and more efficient data communication and lower latency are achieved.
Patent Information
- Application Number
- CN202411954713.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-25
Smart Images

Figure CN119892928A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data communication method, device and equipment for an intelligent automobile operating system. Background Art
[0002] At present, researchers can separate individual functions or modules from the kernel and deploy them as independent services in independent operating environments, so that the kernel retains very few functions and provides these services with basic capabilities such as communication, so that they can cooperate with each other to complete the functions required by the operating system, thereby obtaining a microkernel system. For microkernel operating systems, for the message queue data communication method and the pipe data communication method in the POSIX (Portable Operating System Interface) inter-process communication IPC (Inter-Process Communication), data communication needs to be achieved with the help of service processes. For example, when user processes communicate data between processes through the kernel interface, they need to request the service process, and then realize data communication through the service process.
[0003] In one example, after a user process initiates a data access request (e.g., a read data request or a write data request), it first requests the service process to open the relevant IPC, and then accesses the data through the service process. For example, when writing data, the relevant data needs to be sent to the service process for storage; when reading data, it needs to request the service process to obtain the data. After the data access is completed, it returns to the user process to complete the data communication.
[0004] In the above data communication method, since both writing and reading data are completed through the kernel interface, when writing data from the user process through the kernel interface, the data needs to be copied to the kernel interface first, and then copied from the kernel interface to the service process; when reading data, the data needs to be copied from the service process to the kernel interface first, and then from the kernel interface to the user process. At this time, when performing data communication, it is necessary to copy data multiple times, and there is a performance loss problem. At the same time, this data communication method requires switching processes back and forth. When switching processes, the context of the process needs to be switched synchronously, resulting in a certain scheduling delay, which in turn affects the efficiency of data communication. Summary of the invention
[0005] The present application provides a data communication method, device and equipment for an intelligent automobile operating system, which are used to solve the technical problems of existing data communication methods, such as large performance loss and low communication efficiency.
[0006] In a first aspect, the present application provides a data communication method for an intelligent automobile operating system, the method being applied to a microkernel operating system, comprising:
[0007] In response to the initiated data access request, access control data in the shared memory is obtained; wherein the data access request is used to request to read data or write data; the shared memory represents the memory shared by the parties who perform data communication according to a preset data communication mode; the access control data is used to indicate whether the shared memory can be accessed;
[0008] If it is determined based on the access control data that the shared memory can be accessed, a user process is started to access the shared memory to complete data communication.
[0009] Optionally, the access control data includes lock data and access attribute data; wherein the lock data is used to lock the data; and the access attribute data is used to indicate a cache state of the data; and based on the access control data, determining that the shared memory can be accessed includes:
[0010] Determining cache-related data in the shared memory corresponding to the data access request;
[0011] Determining an access status of the cache-related data based on the access attribute data and the lock data;
[0012] If it is determined based on the access status that the cache-related data can be accessed, then it is determined that the shared memory can be accessed.
[0013] Optionally, determining the access status of the cache-related data based on the access attribute data and the lock data includes:
[0014] Based on the access attribute data, determining a first access state corresponding to the cache-related data; wherein the first access state is used to indicate whether the cache-related data exists;
[0015] In the case where it is determined based on the first access state that the cache-related data exists, determining a locking state of the cache-related data based on the lock data; wherein the locking state indicates whether the cache-related data is locked;
[0016] Based on the lock state of the cache related data, an access state of the cache related data is determined.
[0017] Optionally, determining the access state of the cache-related data based on the lock state of the cache-related data includes:
[0018] If it is determined that the cache-related data is not locked, determining that the access status indicates that the cache-related data can be accessed;
[0019] If it is determined that the cache-related data is locked, it is determined that the access status indicates that the cache-related data cannot be accessed.
[0020] Optionally, the access control data includes a waiting queue; and the method further includes:
[0021] If it is determined based on the access control data that the shared memory cannot be accessed, access waiting information is generated and stored in the waiting queue; wherein the access waiting information represents the user process corresponding to the data access request.
[0022] Optionally, after storing the access waiting information in the waiting queue, the method further includes:
[0023] After detecting that the shared memory can be accessed, the user process is started to access the shared memory.
[0024] Optionally, starting the user process to access the shared memory includes:
[0025] After acquiring lock data corresponding to cache-related data based on the user process, accessing the cache-related data based on the user process;
[0026] After completing access to the cache-related data, the lock data is released.
[0027] Optionally, before obtaining the access control data in the shared memory, the method further includes:
[0028] When it is determined that the data access request is a first access request, a service process is started, and the shared memory is created based on the service process.
[0029] In a second aspect, the present application provides a data communication device for an intelligent automobile operating system, comprising:
[0030] An acquisition unit, configured to acquire access control data in a shared memory in response to an initiated data access request; wherein the data access request is used to request to read data or write data; the shared memory represents a memory shared by parties that perform data communication in accordance with a preset data communication mode; and the access control data is used to indicate whether the shared memory can be accessed;
[0031] The access unit is used to start the user process to access the shared memory and complete the data communication if it is determined that the shared memory can be accessed based on the access control data.
[0032] Optionally, the access control data includes lock data and access attribute data; wherein the lock data is used to lock the data; and the access attribute data is used to indicate a cache state of the data; in this case, the access unit includes a determination module, which is used to:
[0033] Determining cache-related data in the shared memory corresponding to the data access request;
[0034] Determining an access status of the cache-related data based on the access attribute data and the lock data;
[0035] If it is determined based on the access status that the cache-related data can be accessed, then it is determined that the shared memory can be accessed.
[0036] Optionally, a module is determined to:
[0037] Based on the access attribute data, determining a first access state corresponding to the cache-related data; wherein the first access state is used to indicate whether the cache-related data exists;
[0038] In the case where it is determined based on the first access state that the cache-related data exists, determining a locking state of the cache-related data based on the lock data; wherein the locking state indicates whether the cache-related data is locked;
[0039] Based on the lock state of the cache related data, an access state of the cache related data is determined.
[0040] Optionally, a module is determined to:
[0041] If it is determined that the cache-related data is not locked, determining that the access status indicates that the cache-related data can be accessed;
[0042] If it is determined that the cache-related data is locked, it is determined that the access status indicates that the cache-related data cannot be accessed.
[0043] Optionally, the access control data includes a waiting queue; and the access unit further includes an access module, which is used to:
[0044] If it is determined based on the access control data that the shared memory cannot be accessed, access waiting information is generated and stored in the waiting queue; wherein the access waiting information represents the user process corresponding to the data access request.
[0045] Optionally, the access module is also used to:
[0046] After the access waiting information is stored in the waiting queue, after it is detected that the shared memory can be accessed, the user process is started to access the shared memory.
[0047] Optionally, access module for:
[0048] After acquiring lock data corresponding to cache-related data based on the user process, accessing the cache-related data based on the user process;
[0049] After completing access to the cache-related data, the lock data is released.
[0050] Optionally, the device further comprises a creating unit, configured to:
[0051] Before acquiring the access control data in the shared memory, when it is determined that the data access request is a first access request, a service process is started, and the shared memory is created based on the service process.
[0052] In a third aspect, the present application provides a computer device, comprising: a processor, and a memory communicatively connected to the processor;
[0053] The memory stores computer-executable instructions;
[0054] The processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect.
[0055] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement any one of the methods in the first aspect.
[0056] In a fifth aspect, the present application provides a computer program product, comprising: computer execution instructions, the computer execution instructions are stored in a readable storage medium, at least one processor of a computer device can read the computer execution instructions from the readable storage medium, and the at least one processor executes the computer execution instructions, so that the computer device executes the method described in the first aspect.
[0057] The data communication method, device and equipment of the intelligent automobile operating system provided by the present application can obtain the access control data in the shared memory in response to the initiated data access request. Among them, the access control data is used to indicate whether the shared memory can be accessed. At this time, based on the access control data, when it is determined that the shared memory can be accessed, the user process can be started to access the shared memory, thereby completing the data communication. In the above implementation, through the shared memory, it can be realized that only relying on the user process can access the cache-related data, which not only reduces the number of data copies, but also avoids the process switching between the user process and the service process, saves performance, improves efficiency, and thus improves the scheduling delay phenomenon of the intelligent vehicle. At the same time, it is also possible to determine whether the shared memory can be accessed first through the access control data in the shared memory, and then access it when it is determined that the shared memory can be accessed, which can ensure the accuracy of the accessed data, avoid the situation of chaotic access order, and thus improve the accuracy of data communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0059] Figure 1 A schematic diagram of a data communication method for an intelligent automobile operating system provided in an embodiment of the present application;
[0060] Figure 2 A flow chart of another data communication method of an intelligent automobile operating system provided in an embodiment of the present application;
[0061] Figure 3 A schematic diagram of a process of creating and accessing a shared memory provided in an embodiment of the present application;
[0062] Figure 4 A schematic diagram of an implementation flow of a data communication method for an intelligent automobile operating system provided in an embodiment of the present application;
[0063] Figure 5 A schematic diagram of the structure of a data communication device of an intelligent automobile operating system provided in an embodiment of the present application;
[0064] Figure 6 A schematic diagram of the structure of another data communication device of an intelligent automobile operating system provided in an embodiment of the present application;
[0065] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application.
[0066] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0067] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0068] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0069] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0070] In the prior art, the implementation of message queue data communication mode and pipeline data communication mode in the inter-process communication IPC of POSIX in the microkernel operating system is mainly realized through the service process. For example, when writing data, the relevant data to be written needs to be sent to the service process first, so that the service process can save the relevant data to be written; when reading data, the service process is requested to obtain data, so that the service process can obtain the data to be read. After the data access is completed, the access result is returned to the user process to complete the data communication.
[0071] In one example, in the above data communication method, both writing and reading data are completed through the kernel interface between the user process and the service process. Therefore, when writing data, the data can be copied from the user process to the kernel interface first, and then copied from the kernel interface to the service process; when reading data, the data needs to be copied from the service process to the kernel interface first, and then copied from the kernel interface to the user process. This results in the need to copy data multiple times when completing data communication, resulting in certain performance loss problems. At the same time, when the process is switched, the context of the process needs to be switched synchronously, resulting in performance loss, which in turn causes certain scheduling delays, thereby affecting the efficiency and performance of data communication.
[0072] The data communication method of the intelligent automobile operating system provided in this application aims to reduce the number of process switching and data copying by sharing memory, so as to solve the above technical problems of the prior art.
[0073] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0074] Figure 1 A flow chart of a data communication method for an intelligent automobile operating system provided in an embodiment of the present application, which method can be applied to a microkernel operating system, such as Figure 1 As shown, the method includes:
[0075] S101. In response to an initiated data access request, obtain access control data in a shared memory.
[0076] The data access request is used to request to read or write data; the shared memory represents the memory shared by the parties that perform data communication according to a preset data communication method; and the access control data is used to indicate whether the shared memory can be accessed.
[0077] In one example, the preset data communication method can represent the inter-process communication method. For example, the preset data communication method can be a message queue communication method, or a pipe communication method, etc. The preset data communication method is not limited here, and is subject to implementation.
[0078] In one example, access control data is used to indicate whether the shared memory meets the access requirements corresponding to the data access request. For example, if the data access request is a request to read data, then the access control data can be used to indicate whether the cached data corresponding to the data access request in the shared memory can be read; if the data access request is a request to write data, then the access control data can be used to indicate whether the data can be written to the cache location corresponding to the data access request.
[0079] In one example, the access control data may include at least one type of sub-control data, and in this case, whether the shared memory can be accessed can be determined based on each sub-control data included in the access control data. For example, the access control data may include: lock data and access attribute data, wherein the lock data is used to determine whether the cache data or cache location in the shared memory is locked, and the access attribute data is used to determine whether the cache data or cache location exists in the shared memory, so that when it is determined that the cache data or cache location exists in the shared memory and the cache data or cache location is not locked, it can be determined that the shared memory can be accessed.
[0080] S102: If it is determined based on the access control data that the shared memory can be accessed, the user process is started to access the shared memory to complete the data communication.
[0081] In one example, when the data access request is a request to read data, a user process can be started to read cached data stored in the shared memory; when the data access request is a request to write data, the data can be written to the cache location in the shared memory.
[0082] It can be seen from the above description that the embodiment of the present application can obtain access control data in the shared memory in response to the initiated data access request. Among them, the access control data is used to indicate whether the shared memory can be accessed. At this time, based on the access control data, when it is determined that the shared memory can be accessed, the user process can be started to access the shared memory, thereby completing the data communication. In the above implementation, through the shared memory, it can be realized that only relying on the user process can access the cache-related data, which not only reduces the number of data copies, but also avoids the process switching between the user process and the service process, saves performance, improves efficiency, and thus improves the scheduling delay phenomenon of the smart car. At the same time, it is also possible to first determine whether the shared memory can be accessed through the access control data in the shared memory, and then access it when it is determined that the shared memory can be accessed, which can ensure the accuracy of the accessed data, avoid the situation of chaotic access order, and thus improve the accuracy of data communication.
[0083] Figure 2 A flow chart of another data communication method of an intelligent automobile operating system provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the method includes:
[0084] S201. Respond to an initiated data access request.
[0085] The data access request represents a request to read data or write data.
[0086] S202: When it is determined that the data access request is a first access request, start a service process and create a shared memory based on the service process.
[0087] In one example, when the data access request is the first access request, it can represent that the user process opens the inter-process communication IPC for the first time. At this time, the first access request can be passed to the service process through the kernel interface. At this time, the service process can create and initialize a shared memory.
[0088] Afterwards, after detecting the initiated data access request, the shared memory can be used by the user process to complete the corresponding data communication task.
[0089] In one example, Figure 3 A schematic diagram of a process of creating and accessing a shared memory is provided in an embodiment of the present application. Figure 3 As shown, when the user process opens the inter-process communication IPC for the first time, the shared memory can be created by the service process; when the user process does not open the inter-process communication IPC for the first time, the shared memory is used directly.
[0090] In an example, Figure 3 As shown, the shared memory may include access control data and a buffer, wherein the buffer may include cache data and a cache location / cache space (not shown in the figure), wherein the access control data may be used to determine whether the shared memory can be accessed.
[0091] At this time, after receiving the data access request, the access can be performed according to the process described below to complete the data communication.
[0092] S203: In response to the initiated data access request, obtain access control data in the shared memory.
[0093] The shared memory represents the memory shared by all parties performing data communication according to a preset data communication mode; the access control data is used to determine whether to access the data based on a data access request.
[0094] In an example, Figure 3As shown, the access control data may include lock data and access attribute data; wherein the lock data is used to lock the data; the access attribute data is used to indicate the cache status of the data. At this time, the process described below can be used to determine whether the shared memory can be accessed based on the access control data (i.e., the lock data and the access attribute data).
[0095] S204: Determine cache-related data in the shared memory that corresponds to the data access request.
[0096] S205: Determine the access status of cache-related data based on the access attribute data and the lock data.
[0097] S206: If it is determined based on the access status that the cache-related data can be accessed, it is determined that the shared memory can be accessed.
[0098] In one example, the cache-related data may indicate cache data in the shared memory, or indicate a cache location / cache space in the shared memory.
[0099] In an example, if the data access request is a request to read data, then the cache-related data corresponding to the data access request is the cache data; if the data access request is a request to write data, then the cache-related data corresponding to the data access request is the cache location / cache space.
[0100] In specific implementation, the first access state corresponding to the cache-related data may be determined based on the access attribute data, wherein the first access state is used to indicate whether the cache-related data exists.
[0101] At this time, when it is determined based on the first access state that the cache-related data exists, the lock state of the cache-related data is determined based on the lock data, wherein the lock state indicates whether the cache-related data is locked.
[0102] Then, based on the lock state of the cache-related data, the access state of the cache-related data is determined.
[0103] For example, if it is determined that the cache-related data is not locked, then determining that the access state indicates that the cache-related data can be accessed;
[0104] If it is determined that the cache-related data is locked, then it is determined that the access status indicates that the cache-related data cannot be accessed.
[0105] S207: If it is determined based on the access control data that the shared memory can be accessed, the user process is started to access the shared memory to complete the data communication.
[0106] In the above implementation, the data cache situation in the shared memory can be first determined by accessing the attribute data, so that it can be ensured that when it is determined that the cache-related data corresponding to the data access request exists in the shared memory, the shared memory is accessed according to the data access request, so that the problem of access failure due to the non-existence of data can be avoided, thereby improving the accuracy and effectiveness of access. Afterwards, when it is determined that the cache-related data exists, it is determined according to the lock data whether the cache-related data is processed by other user processes, so that when it is determined that the cache-related data is not accessed by other user processes, the shared memory can be accessed, which can not only avoid access conflicts, but also avoid invalid startup of user processes, further improve access accuracy, and save performance.
[0107] In an example, Figure 3 As shown, the access control data may also include a waiting queue, in which the waiting queue may include user processes waiting to access the shared memory. In this case, in addition to executing the above step S207, the embodiment of the present application may also execute the steps described below.
[0108] S208: If it is determined based on the access control data that the shared memory cannot be accessed, access waiting information is generated and stored in a waiting queue.
[0109] The access waiting information represents the user process corresponding to the data access request.
[0110] This implementation can save user processes that need to access cache-related data through a waiting queue, and can ensure the access order when there are many user processes accessing cache-related data, thereby ensuring the accuracy of access.
[0111] S209: After detecting that the shared memory can be accessed, start the user process to access the shared memory.
[0112] This implementation method can determine the time to wake up the user process in a timely and accurate manner by monitoring the access control data.
[0113] In an example, with respect to the steps described in S207 and S209 above: starting a user process to access shared memory may specifically include the following process: based on the user process, obtaining the lock data corresponding to the cache-related data, and then based on the user process, accessing the cache-related data; after completing the access to the cache-related data, releasing the lock data.
[0114] This implementation method allows data access to be completed only through user processes after the shared memory is created, saving performance. It can also ensure the security and unique access to cache-related data by locking data, thereby ensuring the accuracy of data access.
[0115] In one example, Figure 4 The following is a schematic diagram of the implementation process of a data communication method of an intelligent automobile operating system provided in an embodiment of the present application. Figure 4 As shown, after starting data communication in response to a data access request, access control data may be queried based on the shared memory, and then it may be determined based on the access control data whether the shared memory can be accessed based on the data access request.
[0116] If it is determined based on the access control data that the cache-related data corresponding to the data access request exists in the shared memory, it is determined that the shared memory can be accessed. At this time, it can be determined whether the lock data corresponding to the cache-related data is idle (that is, whether it is necessary to wait). If the lock data corresponding to the cache-related data is not idle, it is determined that it is necessary to wait for access. At this time, the synchronization lock can be waited, and after detecting that the synchronization lock is released, the shared memory is started to be accessed, and after acquiring the synchronization lock, the data is read or written. If it is determined that the lock data corresponding to the cache-related data is idle, there is no need to wait, and the shared memory can be directly accessed, and after acquiring the synchronization lock, the data is read or written.
[0117] After completing reading or writing data, release the synchronization lock, complete the data communication, and end.
[0118] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0119] Figure 5 A structural diagram of a data communication device of an intelligent automobile operating system provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the data communication device 500 of the intelligent automobile operating system includes:
[0120] The acquisition unit 501 is used to obtain access control data in the shared memory in response to the initiated data access request; wherein the data access request is used to request to read data or write data; the shared memory represents the memory shared by the parties who perform data communication according to a pre-set data communication method; the access control data is used to indicate whether the shared memory can be accessed.
[0121] The access unit 502 is used to start the user process to access the shared memory and complete the data communication if it is determined that the shared memory can be accessed based on the access control data.
[0122] Figure 6 A structural diagram of another data communication device of an intelligent automobile operating system provided in an embodiment of the present application, such as Figure 6 As shown, the data communication device 600 of the intelligent automobile operating system includes:
[0123] The acquisition unit 601 is used to obtain access control data in the shared memory in response to the initiated data access request; wherein the data access request is used to request to read data or write data; the shared memory represents the memory shared by the parties who perform data communication according to a pre-set data communication method; the access control data is used to indicate whether the shared memory can be accessed.
[0124] The access unit 602 is used to start the user process to access the shared memory and complete the data communication if it is determined that the shared memory can be accessed based on the access control data.
[0125] Optionally, the access control data includes lock data and access attribute data; wherein the lock data is used to lock the data; and the access attribute data is used to indicate the cache status of the data; in this case, the access unit 602 includes a determination module 6021, which is used to:
[0126] determining cache-related data in the shared memory corresponding to the data access request;
[0127] Determine the access status of cache-related data based on the access attribute data and the lock data;
[0128] If it is determined based on the access status that the cache-related data can be accessed, it is determined that the shared memory can be accessed.
[0129] Optionally, the determination module 6021 is used to:
[0130] Based on the access attribute data, determining a first access state corresponding to the cache-related data; wherein the first access state is used to indicate whether the cache-related data exists;
[0131] In the case where it is determined based on the first access state that the cache-related data exists, determining a lock state of the cache-related data based on the lock data; wherein the lock state indicates whether the cache-related data is locked;
[0132] Based on the lock state of the cache-related data, an access state of the cache-related data is determined.
[0133] Optionally, the determination module 6021 is used to:
[0134] If it is determined that the cache-related data is not locked, determining that the access status indicates that the cache-related data can be accessed;
[0135] If it is determined that the cache-related data is locked, then it is determined that the access status indicates that the cache-related data cannot be accessed.
[0136] Optionally, the access control data includes a waiting queue; the access unit further includes an access module 6022, which is used to:
[0137] If it is determined based on the access control data that the shared memory cannot be accessed, access waiting information is generated and stored in a waiting queue; wherein the access waiting information represents the user process corresponding to the data access request.
[0138] Optionally, the access module 6022 is further configured to:
[0139] After the access waiting information is stored in the waiting queue, after it is detected that the shared memory can be accessed, the user process is started to access the shared memory.
[0140] Optionally, the access module 6022 is used to:
[0141] After acquiring the lock data corresponding to the cache-related data based on the user process, the cache-related data is accessed based on the user process;
[0142] After completing access to cache-related data, release the lock data.
[0143] Optionally, the device further includes a creating unit 603, configured to:
[0144] Before acquiring the access control data in the shared memory, when it is determined that the data access request is a first access request, a service process is started, and a shared memory is created based on the service process.
[0145] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the computer device 700 includes: a memory 701 and a processor 702 .
[0146] Memory 701 is a memory used to store instructions executable by processor 702 .
[0147] The processor 702 is configured to execute the method provided in the above embodiment.
[0148] The computer device further includes a receiver 703 and a transmitter 704. The receiver 703 is used to receive instructions and data sent by an external device, and the transmitter 704 is used to send instructions and data to the external device.
[0149] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided in the various embodiments described above.
[0150] Among them, the computer-readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that facilitates the transmission of computer-executable instructions from one place to another. The computer storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. For example, a computer-readable storage medium is coupled to a processor so that the processor can read information from the computer-readable storage medium and write information to the computer-readable storage medium. Of course, the computer-readable storage medium can also be a component of the processor. The processor and the computer-readable storage medium can be located in an application-specific integrated circuit (ASIC). In addition, the ASIC can be located in a user device. Of course, the processor and the computer-readable storage medium can also exist in a communication device as discrete components.
[0151] Specifically, the computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0152] The present application also provides a computer program product, which includes computer-executable instructions, which are stored in a computer-readable storage medium. At least one processor of the device can read the computer-executable instructions from the computer-readable storage medium, and at least one processor executes the computer-executable instructions so that the device implements the methods provided in the various embodiments described above.
[0153] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0154] Among them, each module can be physically separated, for example, installed in different locations of a device, or installed on different devices, or distributed on multiple network units, or distributed on multiple processors. Each module can also be integrated together, for example, installed in the same device, or integrated in a set of codes. Each module can exist in the form of hardware, or can also exist in the form of software, or can also be implemented in the form of software plus hardware. The present application can select some or all of the modules according to actual needs to achieve the purpose of the present embodiment.
[0155] When each module is implemented as an integrated module in the form of a software function module, it can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of each embodiment of the present application.
[0156] It should be understood that, although the various steps in the flowcharts in the above-described embodiments are sequentially displayed according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily to be carried out sequentially, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0157] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0158] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A data communication method for an intelligent automobile operating system, characterized in that: Applied to a microkernel operating system, the method comprises: In response to the initiated data access request, access control data in the shared memory is obtained; wherein the data access request is used to request to read data or write data; the shared memory represents the memory shared by the parties who perform data communication according to a preset data communication mode; the access control data is used to indicate whether the shared memory can be accessed; If it is determined based on the access control data that the shared memory can be accessed, a user process is started to access the shared memory to complete data communication.
2. The method according to claim 1, characterized in that The access control data includes lock data and access attribute data; wherein the lock data is used to lock the data; the access attribute data is used to indicate a cache state of the data; based on the access control data, determining that the shared memory can be accessed includes: Determining cache-related data in the shared memory corresponding to the data access request; Determining an access status of the cache-related data based on the access attribute data and the lock data; If it is determined based on the access status that the cache-related data can be accessed, then it is determined that the shared memory can be accessed.
3. The method according to claim 2, characterized in that Determining the access status of the cache-related data based on the access attribute data and the lock data includes: Based on the access attribute data, determining a first access state corresponding to the cache-related data; wherein the first access state is used to indicate whether the cache-related data exists; In the case where it is determined based on the first access state that the cache-related data exists, determining a locking state of the cache-related data based on the lock data; wherein the locking state indicates whether the cache-related data is locked; Based on the lock state of the cache related data, an access state of the cache related data is determined.
4. The method according to claim 3, characterized in that Determining an access state of the cache-related data based on a lock state of the cache-related data includes: If it is determined that the cache-related data is not locked, determining that the access status indicates that the cache-related data can be accessed; If it is determined that the cache-related data is locked, it is determined that the access status indicates that the cache-related data cannot be accessed.
5. The method according to any one of claims 1 to 4, characterized in that The access control data includes a waiting queue; the method further includes: If it is determined based on the access control data that the shared memory cannot be accessed, access waiting information is generated and stored in the waiting queue; wherein the access waiting information represents the user process corresponding to the data access request.
6. The method according to claim 5, characterized in that After storing the access waiting information in the waiting queue, the method further includes: After detecting that the shared memory can be accessed, the user process is started to access the shared memory.
7. The method according to claim 6, characterized in that Starting the user process to access the shared memory includes: After acquiring lock data corresponding to cache-related data based on the user process, accessing the cache-related data based on the user process; After completing access to the cache-related data, the lock data is released.
8. The method according to any one of claims 1 to 4, characterized in that Before obtaining the access control data in the shared memory, the method further includes: When it is determined that the data access request is a first access request, a service process is started, and the shared memory is created based on the service process.
9. A data communication device for an intelligent automobile operating system, characterized in that: include: An acquisition unit, configured to acquire access control data in a shared memory in response to an initiated data access request; wherein the data access request is used to request to read data or write data; the shared memory represents a memory shared by parties that perform data communication in accordance with a preset data communication mode; and the access control data is used to indicate whether the shared memory can be accessed; The access unit is used to start the user process to access the shared memory and complete the data communication if it is determined that the shared memory can be accessed based on the access control data.
10. A computer device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the data communication method of the intelligent automobile operating system according to any one of claims 1 to 8.