Memory management method and device for vehicle-mounted communication service, equipment and medium
By deploying the status management module in the microprocessor unit, registering, counting and recycling the on-board communication services, the problem of excessive hardware resource consumption in on-board Ethernet communication is solved, and the reliability and resource utilization of communication is improved. .
Patent Information
- Application Number
- CN202411225456.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-27
AI Technical Summary
There are problems of excessive hardware resource consumption and waste of resources in vehicle-mounted Ethernet communication, which leads to an increased risk of communication failure.
Deploy the state management module in the microprocessor unit, register and process the server and client through the state management module, obtain the subject identification number, and communicate through the shared memory, and recycle and cancel the shared memory based on the reference counting results to achieve Effective management of shared memory.
It reduces the waste of memory resources on the on-board platform and improves the reliability and resource utilization of on-board platform communication.
Smart Images

Figure CN119201492A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software development technology, and in particular to a memory management method, device, equipment and medium for an in-vehicle communication service. Background Art
[0002] With the rapid development of in-vehicle Ethernet and communication systems, it has had a disruptive impact on vehicle communications and upper-layer services. However, as an important dimension of computer memory and processor usage in the vehicle platform, in-vehicle Ethernet communication consumes more and more hardware resources, resulting in unnecessary resource consumption and waste. In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose a memory management method, device, equipment and medium for in-vehicle communication services, which can improve resource utilization and communication success rate.
[0004] To achieve the above object, one aspect of an embodiment of the present application provides a memory management method for an in-vehicle communication service, the method comprising:
[0005] deploying a state management module in a microprocessor unit;
[0006] The server and the client are registered by the state management module to obtain a subject identification number; wherein the server and the client communicate via a shared memory;
[0007] Perform reference counting processing on the shared memory according to the subject identification number to obtain a counting result;
[0008] The shared memory is recycled according to the counting result, and the shared memory is deregistered.
[0009] In some embodiments, deploying the state management module in the microprocessor unit comprises the following steps:
[0010] The state management module is developed based on the automotive open system architecture state management specification;
[0011] A microprocessor unit is obtained by developing a communication base based on the adaptive automotive open system architecture communication service specification;
[0012] The state management module is deployed to the microprocessor unit.
[0013] In some embodiments, the registering process of the server and the client through the state management module to obtain the subject identification number includes the following steps:
[0014] Receiving the server parameters sent by the server through the state management module;
[0015] Receiving, through the state management module, client parameters sent by the client;
[0016] Event correlation analysis is performed according to the server parameters and the client parameters to obtain a topic identification number.
[0017] In some embodiments, performing reference counting processing on the shared memory according to the subject identification number to obtain a counting result includes the following steps:
[0018] Initializing the count value of the subject identification number;
[0019] The client or the server performs reference counting processing on the shared memory object, and the count value of the subject identification number is incremented to obtain a counting result.
[0020] In some embodiments, the recycling of the shared memory according to the counting result comprises the following steps:
[0021] The status management module performs operation status monitoring processing on the client and the server according to the counting result to obtain a recycling status;
[0022] The shared memory is recycled according to the recycling status.
[0023] In some embodiments, the reclaiming the shared memory according to the reclaiming state specifically includes at least one of the following steps:
[0024] When the recycling state is that the client and the server do not use the shared memory object, deleting the shared memory object;
[0025] When the recovery state is a process shutdown state of the client or the server, a communication service crash message is returned to the process, and the counting result associated with the process is cleared;
[0026] When the recycling state is memory danger registration, the shared memory object is deleted according to the subject identification number, and the server and the client are closed through the state management module.
[0027] In some embodiments, the deregistering the shared memory comprises the following steps:
[0028] Receiving logout parameters of the server and the client through the state management module;
[0029] The shared memory deregistration process is performed on the server and the client according to the deregistration parameter, and the shared memory object is deleted.
[0030] To achieve the above object, another aspect of an embodiment of the present application provides a memory management device for an in-vehicle communication service, the device comprising:
[0031] A first module is used to deploy a state management module in a microprocessor unit;
[0032] The second module is used to register the server and the client through the state management module to obtain a subject identification number; wherein the server and the client communicate through a shared memory;
[0033] The third module is used to perform reference counting processing on the shared memory according to the subject identification number to obtain a counting result;
[0034] The fourth module is used to recycle the shared memory according to the counting result and cancel the shared memory.
[0035] In some embodiments, the first module, for deploying a state management module in a microprocessor unit, includes:
[0036] The first unit is developed based on the automotive open system architecture state management specification to obtain the state management module;
[0037] The second unit develops a microprocessor unit based on the communication base of the adaptive automotive open system architecture communication service specification;
[0038] The third unit is used to deploy the state management module to the microprocessor unit.
[0039] In some embodiments, the second module is used to register the server and the client through the state management module to obtain the subject identification number, including:
[0040] A fourth unit is used to receive the server parameters sent by the server through the state management module;
[0041] A fifth unit, configured to receive, through the state management module, client parameters sent by the client;
[0042] The sixth unit is used to perform event correlation analysis and processing according to the server parameters and the client parameters to obtain a topic identification number.
[0043] In some embodiments, the third module is used to perform reference counting processing on the shared memory according to the subject identification number to obtain a counting result, including:
[0044] A seventh unit is used to initialize the count value of the subject identification number;
[0045] The eighth unit is used to perform reference counting processing on the shared memory object according to the client or the server, and to perform self-increment processing on the count value of the subject identification number to obtain a counting result.
[0046] In some embodiments, the fourth module is used to recycle the shared memory according to the counting result, including:
[0047] A ninth unit is configured to perform operation status monitoring processing on the client and the server according to the counting result through the status management module to obtain a recycling status;
[0048] The tenth unit is used to recycle the shared memory according to the recycle state.
[0049] In some embodiments, the tenth unit is used to recycle the shared memory according to the recycling state, and specifically includes at least one of the following subunits:
[0050] A first subunit is used to delete the shared memory object when the recycling state is that the client and the server do not use the shared memory object;
[0051] A second subunit is configured to return a communication service crash message to the process and clear the counting result associated with the process when the recovery state is a process shutdown state of the client or the server;
[0052] The third subunit is used to delete the shared memory object according to the subject identification number when the recycling state is memory danger registration, and close the server and the client through the state management module.
[0053] In some embodiments, the fourth module is used to deregister the shared memory, including:
[0054] An eleventh unit is used to receive logout parameters of the server and the client through the state management module;
[0055] The twelfth unit is used to perform a shared memory deregistration process on the server and the client according to the deregistration parameter, and delete the shared memory object.
[0056] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.
[0057] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0058] The embodiments of the present application include at least the following beneficial effects: The present application provides a memory management method, device, equipment and medium for vehicle-mounted communication services, which deploys a state management module in a microprocessor unit; registers the server and the client through the state management module to obtain a subject identification number; wherein the server and the client communicate through shared memory; performs reference counting on the shared memory according to the subject identification number to obtain a counting result; recycles the shared memory according to the counting result and deregisters the shared memory. The present solution recycles and manages the shared memory by counting the references of the global shared memory objects of the platform, which can reduce the waste of platform memory resources and improve the reliability of platform communication during the operation of vehicle-mounted platform communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 is a flow chart of a memory management method for an in-vehicle communication service provided by an embodiment of the present application;
[0060] Figure 2 yes Figure 1 Flow chart of step S101 in FIG.
[0061] Figure 3 yes Figure 1 Flow chart of step S102 in FIG.
[0062] Figure 4 yes Figure 1 Flow chart of step S103 in FIG.
[0063] Figure 5 yes Figure 1 The recycling process flow chart of step S104 in FIG.
[0064] Figure 6 yes Figure 5 Flow chart of step S502 in FIG.
[0065] Figure 7 yes Figure 1 The deregistration flow chart of step S104 in FIG.
[0066] Figure 8 This is a system architecture diagram of platform memory recovery and protection for an in-vehicle communication service provided by an embodiment of the present application;
[0067] Fig. 9 It is a structural diagram of memory management of an in-vehicle communication service provided by an embodiment of the present application;
[0068] Fig.10 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0070] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0071] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0073] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0074] 1) AUTOSAR (Automotive Open System Architecture) is a collaborative development framework jointly established by global automobile manufacturers, parts suppliers, electronics, semiconductor and software system companies. It aims to provide an open and unified software architecture standard for automotive electronic systems.
[0075] 2) Data Distribution Service (DDS) is a distributed real-time communication middleware standard released by OMG (Object Management Group). It uses a publish-subscribe model to achieve reliable, high-performance, interoperable, real-time, and scalable data exchange. The real-time, reliability, and flexibility of DDS make it an ideal choice for autonomous driving system communications. It plays an important role in the field of vehicle communications, especially in autonomous driving systems.
[0076] 3) Electronic Control Unit (ECU), also known as "driving computer" or "on-board computer", is one of the core control components of modern vehicles. ECU is a microcomputer composed of a microprocessor (CPU), memory (ROM, RAM), input / output interface (I / O), analog-to-digital converter (A / D), and large-scale integrated circuits such as shaping and driving.
[0077] 4) An intelligent vehicle is a comprehensive device that integrates environmental perception, planning and decision-making, multi-level assisted driving and other functions. It concentrates on the use of computers, modern sensors, information fusion, communications, artificial intelligence and automatic control technologies. It can exchange information with people, vehicles, roads, etc. through on-board environmental perception devices and information terminals, so that the vehicle has intelligent environmental perception capabilities and can automatically analyze the safety and dangerous status of vehicle driving.
[0078] With the rapid development of in-vehicle Ethernet and communication systems, new applications have been brought to vehicle communications and upper-layer services. However, with the increasing number and communication load of ECUs and various controllers on the automotive platform, the memory usage and load of the entire automotive communication system are also increasing. As an important dimension of computer memory and CPU usage on the automotive platform, in-vehicle Ethernet communication consumes more and more hardware resources. Under this trend of increasing consumption and load of in-vehicle Ethernet communication, it is necessary to reduce unnecessary resource consumption and waste and prevent communication failures due to process problems.
[0079] In view of this, a memory management method, device, electronic device and storage medium for an in-vehicle communication service are provided in an embodiment of the present application. The scheme deploys a state management module in a microprocessor unit; registers the server and the client through the state management module to obtain a subject identification number; wherein the server and the client communicate through shared memory; reference counts the shared memory according to the subject identification number to obtain a counting result; the shared memory is recycled according to the counting result, and the shared memory is deregistered. This scheme recycles and manages the shared memory by counting the references of the platform's global shared memory objects, which can reduce the waste of platform memory resources and improve the reliability of platform communication during the operation of the in-vehicle platform communication.
[0080] A memory management method for an in-vehicle communication service provided in an embodiment of the present application relates to the field of automatic testing technology. A memory management method for an in-vehicle communication service provided in an embodiment of the present application can be applied to a terminal, can be applied to a server, or can be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and an in-vehicle terminal, etc., but is not limited thereto; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed device consisting of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements a memory management method for an in-vehicle communication service, etc., but is not limited to the above forms.
[0081] The present application can be used in many general or special computer device environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor devices, microprocessor-based devices, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above devices or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0082] Figure 1is an optional flowchart of a memory management method for an in-vehicle communication service provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S104.
[0083] Step S101, deploying a state management module in a microprocessor unit;
[0084] Step S102, registering the server and the client through the state management module to obtain a subject identification number; wherein the server and the client communicate through a shared memory;
[0085] Step S103, performing reference counting processing on the shared memory according to the subject identification number to obtain a counting result;
[0086] Step S104: reclaim the shared memory according to the counting result, and deregister the shared memory.
[0087] Steps S101 to S104 shown in the embodiment of the present application are to deploy a state management module in a microprocessor unit; register the server and the client through the state management module to obtain a subject identification number; wherein the server and the client communicate through shared memory; reference count processing is performed on the shared memory according to the subject identification number to obtain a counting result; the shared memory is recycled according to the counting result, and the shared memory is deregistered. This solution recycles and manages the shared memory by counting the references of the shared memory objects of the platform globally, which can reduce the waste of platform memory resources and improve the reliability of platform communication during the operation of the vehicle platform communication. The embodiment of the present application is mainly applicable to the process communication platform system memory optimization of the communication management module based on the adaptive vehicle AUTOSAR standard platform, which can reduce the situation where the memory resource consumption of the platform is too large when the DDS protocol is used for communication and the memory is not recycled when the operating system does not effectively supervise the memory resources, optimize the memory management of the vehicle platform system during operation, and reduce the risk of the process using the same DDS protocol for communication due to the crash of the process when the platform uses the DDS protocol for communication.
[0088] See also Figure 2 In step S101 of some embodiments, the step of deploying the state management module in the microprocessor unit includes the following steps:
[0089] Step S201, developing the state management module based on the automotive open system architecture state management specification;
[0090] Step S202, developing a communication base based on the adaptive automotive open system architecture communication service specification to obtain a microprocessor unit;
[0091] Step S203: deploying the state management module to the microprocessor unit.
[0092] In the embodiment of the present application, a state management module is developed based on the state management specification of the automotive open system architecture. The state management module is deployed in the microprocessor unit (MPU) and can prepare communication services for the MPU and each business module in the ECU and MCU to improve communication efficiency. In addition, the communication base is developed for the communication application in the microprocessor unit based on the adaptive AUOTSAR communication service specification, and the service interfaces such as events (Event), methods (Method), and fields (Field) are specifically designed to match events, methods, and the two. Similarly, the communication base is developed for the communication application on the microprocessor (MCU) based on the AUOTSAR CP communication service specification. By deploying the state management module in the microprocessor unit, the embodiment of the present application can provide state management for the microprocessor unit when communicating with other components through the state management module, which provides a basis for subsequent memory management.
[0093] See also Figure 3 In step S102 of some embodiments, the registration process of the server and the client through the state management module to obtain the subject identification number includes the following steps:
[0094] Step S301, receiving server parameters sent by the server through the state management module;
[0095] Step S302, receiving the client parameters sent by the client through the state management module;
[0096] Step S303: performing event correlation analysis and processing according to the server parameters and the client parameters to obtain a topic identification number.
[0097] In an embodiment of the present application, the server and the client are registered and processed by the state management module, wherein the server can be an MCU or an MPU, and correspondingly, the client is an MPU or an MCU, that is, the server and the client are judged according to which component initiates the request message, and the end that initiates the request message is the server, and the server and the client deployed on the MCU and the MPU communicate through shared memory. Specifically, before the server sends a service request (Offer Service) message, the server parameters are sent to the state management module through the service, and the server parameters may include the platform process number of the server, the shared memory address, the service topic (Service Topic) and the event identification number (Event ID). The service can adopt a triggering mechanism, which can receive external or internal trigger signals (Tr igger), and start, stop, modify or execute specific service operations according to these signals. Before the client subscribes (Subscribe), the client's platform process number, shared memory address, event topic (Event Topic) and event identification number (Event ID) are sent to the state management module through the service to register the shared memory object reference counting recycling mechanism. Among them, the subscription process can use the FindService() function and StartFindService() function. Among them, the main function of the FindService() function can be to search or find a service in the system, and the StartFindService() function can be to start the search service. At this time, the shared memory object reference counting recycling mechanism registration will initialize the global topic (Topic) of DDS communication. It should be noted that the Topic of the server and client of an Event event is the same; there are two Topics for a Method event: RequestTopic and ReplyTopic; Field is a RequestTopic and ReplyTopic with two Getter and Setter Methods attached to the Topic with the function base of Event. Specifically, the shared memory object reference counting recycling mechanism will integrate the associated Topics to obtain the topic identification number (Topic ID), and initialize the count value of the Topic ID to 0. The specific event association rules are: the Topic of the related Event event is a unique Topic ID; the shared memory object reference counting recycling mechanism will determine the Method event: RequestTopic and ReplyTopic are unified Topic IDs, and jointly determine whether the same Topic ID is recorded through the platform process number and Topic and Event ID of the two.The embodiment of the present application records the subject identification number associated with the event, thereby facilitating subsequent management such as memory recovery based on the count value of the subject identification number, thereby improving the reliability of platform communication.
[0098] See also Figure 4 In step S103 of some embodiments, performing reference counting processing on the shared memory according to the subject identification number to obtain a counting result includes the following steps:
[0099] Step S401, initializing the count value of the subject identification number;
[0100] Step S402: performing reference counting processing on the shared memory object according to the client or the server, and performing self-increment processing on the count value of the subject identification number to obtain a counting result.
[0101] In the embodiment of the present application, the count value of the subject identification number is initialized to zero, and the references to the shared memory object applied by the client or the server are counted. When either party makes a reference, the count value of the subject identification number is incremented by one to obtain the count result. By recording the count result, the embodiment of the present application can recycle the shared content and reduce the risk of wasting resources.
[0102] See also Figure 5 In step S104 of some embodiments, the recycling of the shared memory according to the counting result includes the following steps:
[0103] Step S501, monitoring the running status of the client and the server according to the counting result through the status management module to obtain the recycling status;
[0104] Step S502: recycle the shared memory according to the recycle status.
[0105] In an embodiment of the present application, the running state of the process using the shared memory object reference counting recycling mechanism on the client and server is continuously monitored through the state management module, and the shared memory is recycled when the running state reaches a recyclable state. The embodiment of the present application monitors the process and recycles the shared memory when the process is in the recycling state.
[0106] See also Figure 6 In step S502 of some embodiments, the reclaiming of the shared memory according to the reclaiming state specifically includes at least one of the following steps:
[0107] Step S601, when the recycling status is that the client and the server do not use the shared memory object, the shared memory object is deleted;
[0108] Step S602, when the recovery state is a process shutdown state of the client or the server, a communication service crash message is returned to the process, and the counting result associated with the process is cleared;
[0109] Step S603: when the recycling state is memory danger registration, the shared memory object is deleted according to the subject identification number, and the server and the client are closed through the state management module.
[0110] In an embodiment of the present application, when the recovery state is that the client and the server do not use the shared memory object, that is, the value of the topic identification number (Topic ID) is judged to be 0, and the shared memory object of the topic identification number is deleted. When the state management module detects that the process on the client or server side has been closed, but the process does not call the object cancellation function of the shared memory object reference counting recovery mechanism, the message of the DDS communication service crash is sent to all processes that are still using the shared memory through the TriggerOut service, and the parameters during the internal registration of the process determine whether to ignore or take action on the message, and the values of all Topic IDs associated with the process are cleared. When the recovery state is a memory danger registration, it is necessary to shut down all servers and clients and delete the shared memory object, and close the server and client of the relevant topic through the state management module. The embodiment of the present application monitors the communication between the client and the server through the state management module, and recycles the shared memory when the recovery state occurs, which can improve the resource utilization and protection efficiency of the real vehicle on-board intelligent driving platform.
[0111] See also Figure 7 In step S104 of some embodiments, the deregistration of the shared memory includes the following steps:
[0112] Step S701, receiving the logout parameters of the server and the client through the state management module;
[0113] Step S702: performing a shared memory deregistration process on the server and the client according to the deregistration parameter, and deleting the shared memory object.
[0114] In an embodiment of the present application, when the server and client associated with a certain topic perform client destructing or perform server closing service request (StopOfferService), the server and client send the cancellation parameter to the state management module through the Trigger In service to perform the shared memory cancellation operation, wherein the cancellation parameter may include Service Topic and Event ID or Event Topic and Event ID. According to the shared memory cancellation process, the value of the topic identification number is reduced by one. After all the servers and clients associated with a certain Topic perform the memory cancellation operation, it is determined that the value of Topic ID is 0, and the shared memory object associated with Topic ID is deleted. The shared memory object reference counting recovery mechanism stops monitoring the shared memory, and the relevant supervision mechanism also ends.
[0115] The following is a detailed description of the embodiments of the present invention with reference to specific application examples:
[0116] The embodiments of the present application can be applied to the field of vehicle controller MPU end software development, and particularly to a DDS vehicle communication memory recovery and protection mechanism based on the AUTOSAR communication framework. Figure 8 , the ECU and MPU in the vehicle controller and the MPU and MCU communicate through shared memory, and the Topic characteristics of the events and methods in the service are used to perform DDS communication. When the DDS protocol service discovery and event subscription objects are created and destroyed, the MPU chip is used as the AUTOSAR operating system carrier through the platform global shared memory object reference counting recovery mechanism to complete the optimization of the platform memory of the DDS vehicle communication service and the platform memory recovery of the Topic in the DDS protocol, which can reduce the waste of platform memory resources and improve the reliability of platform communication during the operation of the vehicle platform communication. The embodiment of the present application realizes the optimization of platform resources and can effectively improve the resource utilization and protection efficiency of the real vehicle vehicle intelligent driving platform.
[0117] See also Fig. 9 The embodiment of the present application also provides a memory management device for an in-vehicle communication service, the device comprising:
[0118] The first module 901 is used to deploy a state management module in a microprocessor unit;
[0119] The second module 902 is used to register the server and the client through the state management module to obtain a subject identification number; wherein the server and the client communicate through a shared memory;
[0120] The third module 903 is used to perform reference counting processing on the shared memory according to the subject identification number to obtain a counting result;
[0121] The fourth module 904 is used to recycle the shared memory according to the counting result and cancel the shared memory.
[0122] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0123] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the memory management method of the above-mentioned vehicle communication service when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0124] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0125] See also Fig.10 , Fig.10 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0126] The processor 1001 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0127] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store operating devices and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the memory management method of the vehicle communication service of the embodiment of this application;
[0128] Input / output interface 1003, used to implement information input and output;
[0129] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WI FI, Bluetooth, etc.);
[0130] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );
[0131] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .
[0132] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a computer processor, it implements the memory management method of the above-mentioned vehicle-mounted communication service.
[0133] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0134] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0135] The embodiment of the present application provides a memory management method, device, equipment and medium for an in-vehicle communication service. The scheme deploys a state management module in a microprocessor unit; registers the server and the client through the state management module to obtain a subject identification number; wherein the server and the client communicate through shared memory; performs reference counting on the shared memory according to the subject identification number to obtain a counting result; recycles the shared memory according to the counting result and deregisters the shared memory. The scheme recycles the shared memory by counting the references of the global shared memory objects of the platform, which can reduce the waste of platform memory resources and improve the reliability of platform communication during the operation of the in-vehicle platform communication.
[0136] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0137] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0138] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0139] Those skilled in the art will appreciate that all or some of the steps, devices, and functional modules / units in the above disclosed methods may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0140] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0141] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: 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] 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 the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, 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 units, which can be electrical, mechanical or other forms.
[0143] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0144] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0145] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0146] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A memory management method for an in-vehicle communication service, characterized in that: The method comprises the following steps: deploying a state management module in a microprocessor unit; The server and the client are registered by the state management module to obtain a subject identification number; wherein the server and the client communicate via a shared memory; Perform reference counting processing on the shared memory according to the subject identification number to obtain a counting result; The shared memory is recycled according to the counting result, and the shared memory is deregistered.
2. The method according to claim 1, characterized in that: The step of deploying the state management module in the microprocessor unit comprises the following steps: The state management module is developed based on the automotive open system architecture state management specification; A microprocessor unit is obtained by developing a communication base based on the adaptive automotive open system architecture communication service specification; The state management module is deployed to the microprocessor unit.
3. The method according to claim 1, characterized in that The process of registering the server and the client through the state management module to obtain a subject identification number includes the following steps: Receiving the server parameters sent by the server through the state management module; Receiving, through the state management module, client parameters sent by the client; Event correlation analysis is performed according to the server parameters and the client parameters to obtain a topic identification number.
4. The method according to claim 1, characterized in that: The process of performing reference counting processing on the shared memory according to the subject identification number to obtain a counting result comprises the following steps: Initializing the count value of the subject identification number; The client or the server performs reference counting processing on the shared memory object, and the count value of the subject identification number is incremented to obtain a counting result.
5. The method according to claim 1, characterized in that The recycling process of the shared memory according to the counting result comprises the following steps: The status management module performs operation status monitoring processing on the client and the server according to the counting result to obtain a recycling status; The shared memory is recycled according to the recycling status.
6. The method according to claim 5, characterized in that The recycling process of the shared memory according to the recycling state specifically includes at least one of the following steps: When the recycling status is that the client and the server do not use the shared memory object, deleting the shared memory object; When the recovery state is a process shutdown state of the client or the server, a communication service crash message is returned to the process, and the counting result associated with the process is cleared; When the recycling state is memory danger registration, the shared memory object is deleted according to the subject identification number, and the server and the client are closed through the state management module.
7. The method according to claim 1, characterized in that The deregistration of the shared memory comprises the following steps: Receiving logout parameters of the server and the client through the state management module; The shared memory deregistration process is performed on the server and the client according to the deregistration parameter, and the shared memory object is deleted.
8. A memory management device for an in-vehicle communication service, characterized in that: The device comprises: A first module is used to deploy a state management module in a microprocessor unit; The second module is used to register the server and the client through the state management module to obtain a subject identification number; wherein the server and the client communicate through a shared memory; The third module is used to perform reference counting processing on the shared memory according to the subject identification number to obtain a counting result; The fourth module is used to recycle the shared memory according to the counting result and cancel the shared memory.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
