RESOURCE MANAGEMENT DEVICE, RESOURCE MANAGEMENT METHOD, AND COMPUTER PROGRAM FOR RESOURCE MANAGEMENT

The resource management device prioritizes higher-priority processes by tracking shared resource usage and suspending lower-priority processes, ensuring timely execution in systems with shared resources.

JP7589712B2Active Publication Date: 2024-11-26TOYOTA JIDOSHA KK
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2022081059
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2024-11-26
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

In systems where multiple processes share resources, a process with lower priority may occupy the resource first, leading to the need for higher-priority processes to wait for execution.

Method used

A resource management device that tracks the priority and range of shared resources used by each process, suspending lower-priority processes if a higher-priority process is using the same resource, ensuring that higher-priority processes are executed preferentially.

Benefits of technology

Ensures that processes with higher priority are executed without waiting for lower-priority processes, maintaining efficient resource utilization and timely execution of critical tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007589712000001
    Figure 0007589712000001
  • Figure 0007589712000002
    Figure 0007589712000002
  • Figure 0007589712000003
    Figure 0007589712000003
Patent Text Reader

Abstract

To provide a resource management device that can ensure that a high-priority process is preferentially executed among multiple processes using a shared resource.SOLUTION: A resource management device includes: an update unit 34 configured to update registered process information indicating priority of a process in execution and an area in a shared resource 241 used by the process, at every start or end of execution of one of processes using the shared resource 241: a determination unit 35 configured to determine, when a first process in execution rewrites data stored in the shared resource 241, whether a second process using an area in the shared resource 241 used by the first process exists, by referring to the registered process information; and a process control unit 36 configured to interrupt the first process until termination of the second process when the second process having higher priority than that of the first process exists, and interrupt the second process until termination of the first process when the second process having lower priority than that of the first process exists.SELECTED DRAWING: Figure 3
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a resource management method and a computer program for managing a shared resource that can be commonly used by a plurality of processes. [Background technology]

[0002] 2. Description of the Related Art In a system capable of executing a plurality of processes in parallel, a technique has been proposed for dynamically determining the execution order of each process (see Patent Document 1).

[0003] The method disclosed in Patent Document 1 dynamically determines which instruction should be issued in each clock cycle from among multiple available instructions in a multi-threaded processor capable of issuing multiple instructions in each clock cycle. The method determines a highest priority instruction from among the multiple available instructions and determines compatibility of the highest priority instruction with each of the remaining available instructions. In this regard, the method determines that the instructions are compatible with each other if they do not require the same resources. The method then issues the highest priority instruction in the same clock cycle with other instructions that are compatible with the highest priority instruction and are compatible with each other. The highest priority instruction is not considered a speculative instruction. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] Special Publication No. 2012-525620 Summary of the Invention [Problem to be solved by the invention]

[0005] Among multiple processes being executed simultaneously, a process with a relatively low priority may occupy a shared resource first. In such a case, among the multiple processes being executed simultaneously, a process with a relatively high priority must wait for execution.

[0006] SUMMARY OF THE PRESENT EMBODIMENTS Accordingly, an object of the present invention is to provide a resource management device that can ensure that, among a plurality of processes that use a shared resource, a process having a higher priority is executed preferentially. [Means for solving the problem]

[0007] According to one embodiment, a resource management device is provided, which includes a storage unit that stores process registration information indicating the priority of a process among a plurality of processes that is being executed using a shared resource and the range of the shared resource used by the process being executed, an update unit that updates the process registration information so as to add the priority of the process and the range of the shared resource to the process registration information each time the execution of any of the plurality of processes is started, and delete the priority of the process and the range of the shared resource from the process registration information each time the use of the shared resource for any of the plurality of processes is ended, a determination unit that refers to the process registration information and determines whether or not a second process among the plurality of processes that is being executed using the range of the shared resource used by the first process exists when a first process among the plurality of processes that is being executed using the shared resource rewrites data stored in the shared resource, and a process control unit that suspends the first process until the second process ends if a second process having a higher priority than the first process exists, and suspends the second process until the first process ends if a second process having a lower priority than the first process exists.

[0008] In this resource management device, when the process control unit interrupts a first process, it is preferable that the process control unit re-executes the first process from the beginning when a second process having a higher priority than the first process is completed.

[0009] In addition, in this resource management device, one of the multiple processes is an object detection process that detects a specific object represented in a sensor signal generated by the sensor, and another of the multiple processes is an anomaly detection process that detects an abnormality or malfunction that has occurred in the sensor, and it is preferable that the priority of the anomaly detection process is set higher than the priority of the object detection process.

[0010] According to another aspect of the present invention, there is provided a resource management method, which includes the steps of: adding a priority and a range of a shared resource for any one of a plurality of processes to process registration information stored in a storage unit, the process registration information indicating a priority of a process being executed using a shared resource and a range of a shared resource used by the process being executed, the process registration information being updated, the priority and the range of a shared resource for any one of the plurality of processes being executed, the process registration information being updated, and when a first process being executed using a shared resource among the plurality of processes rewrites data stored in the shared resource, the process registration information is referenced to determine whether or not a second process being executed using the range of a shared resource used by the first process among the plurality of processes exists, and if a second process having a higher priority than the first process exists, the first process is suspended until the second process is terminated, and if a second process having a lower priority than the first process exists, the second process is suspended until the first process is terminated.

[0011] According to yet another aspect of the present invention, there is provided a computer program for resource management, which includes instructions for causing a computer to execute the following: each time execution of any one of a plurality of processes is started, add the priority of the process and the range of the shared resource for the process to process registration information stored in a storage unit, the process registration information indicating the priority of the process being executed using the shared resource and the range of the shared resource used by the process being executed, and update the process registration information to delete the priority of the process and the range of the shared resource for the process from the process registration information each time use of the shared resource for any one of the plurality of processes is terminated; when a first process among the plurality of processes being executed using the shared resource rewrites data stored in the shared resource, refer to the process registration information to determine whether or not a second process among the plurality of processes is being executed using the range of the shared resource used by the first process, and if a second process having a higher priority than the priority of the first process is present, suspend the first process until the second process is terminated; and if a second process having a lower priority than the priority of the first process is present, suspend the second process until the first process is terminated. Effect of the Invention

[0012] The resource management device according to the present invention has an advantage that it is possible to ensure that a process having a higher priority among a plurality of processes using a shared resource is executed preferentially. [Brief description of the drawings]

[0013] [Figure 1] 1 is a schematic configuration diagram of a vehicle control system in which a resource management device is implemented. [Diagram 2] 1 is a hardware configuration diagram of an electronic control device that is an embodiment of a resource management device. [Diagram 3] FIG. 2 is a functional block diagram of a processor of an electronic control unit for vehicle control processing including resource management processing. [Figure 4] FIG. 1 is a diagram illustrating an overview of a resource management process. [Diagram 5] 13 is an operational flowchart of a resource management process. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0014] Hereinafter, a resource management device, a resource management method executed in the resource management device, and a computer program for resource management will be described with reference to the drawings. The resource management device uses process registration information to manage the priority of a process being executed using a shared resource among a plurality of processes and the range of the shared resource used by the process. That is, the resource management device adds the priority of the process and the range of the shared resource used by the process to the process registration information every time the execution of any process is started. Moreover, the resource management device deletes the priority of the process and the range of the shared resource from the process registration information every time the use of the shared resource for any process is ended. Furthermore, when a first process being executed using the shared resource rewrites data stored in the shared resource, the resource management device refers to the process registration information. Then, the resource management device determines whether or not a second process being executed using the range of the shared resource used by the first process exists. When a second process exists and the priority of the second process is higher than the priority of the first process, the resource management device suspends the first process until the second process ends. On the other hand, when a second process exists and the priority of the second process is lower than the priority of the first process, the resource management device suspends the second process until the first process is completed.

[0015] An example in which the resource management device is applied to a vehicle control system will be described below. In this example, the resource management device detects objects present around the vehicle from images obtained by a camera mounted on the vehicle, and performs automatic driving control of the vehicle so that the detected objects do not collide with the vehicle. At this time, the resource management device temporarily stores the images received from the camera in a shared resource. The resource management device then executes a process of detecting objects based on the images stored in the shared resource (hereinafter referred to as object detection process) and a process of detecting a failure or malfunction of the camera (hereinafter referred to as abnormality detection process).

[0016] FIG. 1 is a schematic diagram of a vehicle control system in which a resource management device is implemented. FIG. 2 is a hardware configuration diagram of an electronic control device, which is an embodiment of the resource management device. In this embodiment, a vehicle control system 1 mounted on a vehicle 10 and controlling the vehicle 10 includes a camera 2 for capturing images of the surroundings of the vehicle 10 and an electronic control unit (ECU) 3, which is an example of a resource management device. The camera 2 and the ECU 3 are communicatively connected via an in-vehicle network conforming to a standard such as a controller area network. The vehicle control system 1 may further include a storage device (not shown) for storing a map used for automatic driving control of the vehicle 10. Furthermore, the vehicle control system 1 may include a distance sensor (not shown) such as a LiDAR or a radar for measuring the distance to an object around the vehicle 10. Furthermore, the vehicle control system 1 may include a receiver (not shown) for measuring the self-position of the vehicle 10 in accordance with a satellite positioning system, such as a GPS receiver. Furthermore, the vehicle control system 1 may also include a wireless terminal (not shown) for wireless communication with other devices, and a navigation device (not shown) for searching for a planned travel route for the vehicle 10, and the like.

[0017] The camera 2 is an example of a sensor, and has a two-dimensional detector configured with an array of photoelectric conversion elements sensitive to visible light, such as a CCD or C-MOS, and an imaging optical system that forms an image of an area to be photographed on the two-dimensional detector. The camera 2 is attached, for example, in the passenger compartment of the vehicle 10, facing the front of the vehicle 10 so as to photograph a predetermined area ahead of the vehicle 10. Note that the vehicle 10 may be provided with a plurality of cameras with different photographing directions or focal lengths. The camera 2 photographs a predetermined area around the vehicle 10 at a predetermined photographing period (for example, 1 / 30 to 1 / 10 seconds) and generates an image showing the predetermined area. The image obtained by the camera 2 may be a color image or a gray image. The image obtained by the camera 2 is an example of data to be subjected to each of a plurality of processes to which priority is assigned, and is also an example of a sensor signal.

[0018] Every time the camera 2 generates an image, it outputs the generated image to the ECU 3 via the in-vehicle network.

[0019] The ECU 3 controls the automatic driving of the vehicle 10. In this embodiment, the ECU 3 controls the vehicle 10 so as to automatically drive the vehicle 10 based on an object detected from a series of time-series images acquired by the camera 2. To this end, the ECU 3 has a communication interface 21, a memory 22, a buffer memory 23, and a processor 24. Note that the communication interface 21, the memory 22, the buffer memory 23, and the processor 24 may be configured as different circuits, or may be integrated into a single integrated circuit.

[0020] The communication interface 21 has an interface circuit for connecting the ECU 3 to an in-vehicle network. That is, the communication interface 21 is connected to the camera 2 via the in-vehicle network. Then, every time the communication interface 21 receives an image from the camera 2, it passes the received image to the processor 24.

[0021] The memory 22 is an example of a storage unit, and includes, for example, a volatile semiconductor memory and a non-volatile semiconductor memory. The memory 22 stores an algorithm for the vehicle control process executed by the processor 24 of the ECU 3, and various data and parameters used in the vehicle control process. For example, the memory 22 stores map information, a parameter set for identifying a classifier used in the vehicle control process, and the priorities of a plurality of processes executed on an image. Furthermore, the memory 22 stores various data generated during the vehicle control process, such as process registration information and information about detected objects, for a certain period of time.

[0022] The buffer memory 23 is another example of a storage unit, and includes, for example, a volatile semiconductor memory. The buffer memory 23 temporarily stores images received from the camera via the communication interface 21.

[0023] The processor 24 is an example of a control unit. In this embodiment, the processor 24 has, for example, one or more CPUs (Central Processing Units) and their peripheral circuits. The processor 24 may further have a numerical calculation circuit or a graphics processing circuit (Graphics Processing Unit, GPU). Furthermore, the processor 24 has a shared memory 241. The shared memory 241 is an example of a shared resource, and is configured as, for example, a memory circuit accessible from each calculation circuit or each processing circuit such as the CPU and GPU of the processor 24.

[0024] While the vehicle 10 is traveling, each time the processor 24 receives an image from the camera 2, the processor 24 writes the received image into the buffer memory 23. Furthermore, the processor 24 executes vehicle control processing based on the images stored in the buffer memory 23.

[0025] FIG. 3 is a functional block diagram of the processor 24 of the ECU 3, which is related to the vehicle control process including the resource management process. The processor 24 has an object detection unit 31, an abnormality detection unit 32, a vehicle control unit 33, an update unit 34, a determination unit 35, and a process control unit 36. Each of these units of the processor 24 is a functional module realized by, for example, a computer program running on the processor 24. Among these units of the processor 24, the processes executed by the update unit 34, the determination unit 35, and the process control unit 36 ​​correspond to the resource management process, and are executed by, for example, any of the CPUs of the processor 24. The object detection process executed by the object detection unit 31 and the abnormality detection process executed by the abnormality detection unit 32 are each an example of a plurality of processes executed using the shared memory 241, which is an example of a shared resource. Furthermore, in this embodiment, the object detection process and the abnormality detection process are executed asynchronously with each other, and the priority of the process of the abnormality detection unit 32 is higher than the priority of the process of the object detection unit 31. Therefore, the execution of the abnormality detection process is prevented from being put on hold due to the execution of the object detection process. As a result, when an abnormality or malfunction occurs in the camera 2, the processor 24 can transfer the control subject of the vehicle 10 to the driver without delay. Note that the multiple processes executed using the shared memory 241 may include processes other than the object detection process and the abnormality detection process. For example, the process by the vehicle control unit 33 may also be executed using the shared memory 241. Furthermore, the memory area of ​​the shared memory 241 where each process writes data or where the written data is referenced is an example of the range of the shared resource used by each process.

[0026] The object detection unit 31 inquires of the process control unit 36 ​​about permission to execute the object detection process at each first period. When permission to execute the object detection process is obtained from the process control unit 36, the latest image stored in the buffer memory 23 is written to the shared memory 241. Then, the object detection unit 31 notifies the update unit 34 of process start information including identification information and priority of the object detection process and information indicating a memory area in the shared memory 241 to be used by the object detection unit 31. Furthermore, the object detection unit 31 executes the object detection process on the image written to the shared memory 241. Then, through the object detection process, the object detection unit 31 detects objects around the vehicle 10 that are the detection targets shown in the image.

[0027] In this embodiment, the object detection unit 31 detects an object region including an object to be detected that is shown in the image by inputting an image to a classifier, and classifies the type of the object to be detected. The objects to be detected include, for example, other vehicles, pedestrians, road markings such as lane markings, various road signs, and traffic lights. The object detection unit 31 can use a so-called deep neural network (hereinafter, simply referred to as DNN) as such a classifier. The DNN used as the classifier can have a convolutional neural network type architecture such as Single Shot MultiBox Detector (SSD) or Faster R-CNN. Alternatively, the DNN used as the classifier may have a self-attention network type architecture such as Vision Transformer. Such a classifier is trained in advance to detect the object to be detected from the image according to a predetermined learning method such as the backpropagation method, using a large number of images (teacher images) showing the object to be detected.

[0028] The processing of the object detection unit 31 is executed by an arithmetic circuit such as a GPU included in the processor 24. The object detection unit 31 (effectively an arithmetic circuit that executes the processing of the object detection unit 31; the same applies below) reads an image from the shared memory 241 and inputs the read image to a classifier to detect an object to be detected. At that time, the object detection unit 31 writes intermediate data generated during the calculation by the classifier to the shared memory 241. However, the object detection unit 31 notifies the determination unit 35 and the process control unit 36 ​​of rewrite information including identification information of the process that writes the intermediate data and information indicating the area to write the intermediate data. Then, when the object detection unit 31 obtains permission to write the intermediate data from the process control unit 36, it writes the intermediate data to the shared memory 241.

[0029] On the other hand, if permission to write the intermediate data is not obtained, the object detection unit 31 waits until a retry request is notified from the process control unit 36. When the retry request is notified, the object detection unit 31 restarts the object detection process from the beginning. At that time, the object detection unit 31 reads out the latest image from the buffer memory 23 again and writes the latest image to the shared memory 241. The object detection unit 31 then re-executes the object detection process on the latest image written to the shared memory 241.

[0030] Furthermore, when a retry request is notified from the process control unit 36 ​​during the execution of the object detection process, regardless of whether intermediate data has been written or not, the object detection unit 31 also restarts the object detection process from the beginning, in the same manner as described above.

[0031] When the object detection unit 31 detects an object to be detected from an image, it notifies the vehicle control unit 33 of detection information indicating the position and range of an object area in the image in which the object to be detected is depicted, and the type of object included in the object area. In addition, the object detection unit 31 outputs to the update unit 34 a processing end notification indicating that the object detection processing has ended.

[0032] The abnormality detection unit 32 inquires of the process control unit 36 ​​about permission to execute the abnormality detection process at each second period different from the first period. When permission to execute the abnormality detection process is obtained from the process control unit 36, the abnormality detection unit 32 writes a series of images acquired during a certain period of time most recently stored in the buffer memory 23 to the shared memory 241. The abnormality detection unit 32 then notifies the update unit 34 of process start information including identification information and priority of the abnormality detection process and information indicating a memory area in the shared memory 241 to be used by the abnormality detection unit 32. Furthermore, the abnormality detection unit 32 executes the abnormality detection process for the series of images written to the shared memory 241. The abnormality detection unit 32 then detects an abnormality or malfunction occurring in the camera 2 through the abnormality detection process.

[0033] In this embodiment, the abnormality detection unit 32 calculates the average or median of pixel values ​​for each of a series of images as an abnormality index value. Then, the abnormality detection unit 32 determines whether the abnormality index value calculated for each image satisfies the abnormality determination condition. For example, when the abnormality index value calculated for each image is smaller than a blocked-up black threshold indicating that the entire image is blocked-up black, the abnormality detection unit 32 determines that the abnormality determination condition is satisfied. Also, when the abnormality index value calculated for each image is larger than a blown-out highlight threshold indicating that the entire image is blown-out highlight, the abnormality detection unit 32 determines that the abnormality determination condition is satisfied.

[0034] The processing of the anomaly detection unit 32 is executed by an arithmetic circuit such as a CPU included in the processor 24. The anomaly detection unit 32 (effectively an arithmetic circuit that executes the processing of the anomaly detection unit 32; the same applies below) reads a series of images from the shared memory 241 and executes the above-mentioned anomaly detection processing on the series of images read in, thereby determining whether or not the anomaly determination condition is satisfied. At that time, the anomaly detection unit 32 writes intermediate data generated during the anomaly detection processing, such as an anomaly index value for each image, to the shared memory 241. However, the anomaly detection unit 32 notifies the determination unit 35 and the processing control unit 36 ​​of rewrite information including identification information of the processing for writing the intermediate data and information indicating the area to write the intermediate data. Then, when permission to write the intermediate data is obtained from the processing control unit 36, the anomaly detection unit 32 writes the intermediate data to the shared memory 241.

[0035] On the other hand, if permission to write the intermediate data is not obtained, the anomaly detection unit 32 waits until a retry request is notified from the process control unit 36. When a retry request is notified, the anomaly detection unit 32 restarts the anomaly detection process from the beginning. At that time, the anomaly detection unit 32 reads again the series of images from the most recent period from the buffer memory 23 and writes the latest images to the shared memory 241. The anomaly detection unit 32 then re-executes the anomaly detection process on the series of images written to the shared memory 241.

[0036] Furthermore, when a retry request is sent from the process control unit 36 ​​during the execution of the abnormality detection process, regardless of whether intermediate data has been written or not, the abnormality detection unit 32 restarts the abnormality detection process from the beginning, in the same manner as described above.

[0037] When the abnormality determination condition is satisfied, the abnormality detection unit 32 notifies the vehicle control unit 33 that an abnormality or malfunction has occurred in the camera 2. In addition, the abnormality detection unit 32 outputs a processing end notification indicating that the abnormality detection processing has ended to the update unit 34.

[0038] The vehicle control unit 33 generates one or more planned driving routes (trajectories) of the vehicle 10 in a nearby predetermined section (for example, 500 m to 1 km) so that the vehicle 10 proceeds along a planned driving route to the destination. The planned driving route is expressed, for example, as a set of target positions of the vehicle 10 at each time when the vehicle 10 travels through the predetermined section. The vehicle control unit 33 then controls each part of the vehicle 10 so that the vehicle 10 travels along the planned driving route. The processing of the vehicle control unit 33 is executed by an arithmetic circuit such as a CPU included in the processor 24.

[0039] The vehicle control unit 33 generates a planned driving route so as to prevent the vehicle 10 from colliding with objects (e.g., other vehicles) present around the vehicle 10, which are detected from a series of time-series images acquired by the camera 2. To this end, the vehicle control unit 33 tracks the detected objects by referring to the detection information for each of the series of images notified by the object detection unit 31.

[0040] For example, the vehicle control unit 33 applies a tracking process based on optical flow, such as the Lucas-Kanade method, to the object region of interest in the latest image obtained by the camera 2 and the object region in the past image, thereby tracking the object represented in the object region. For this purpose, the vehicle control unit 33 applies a filter for extracting feature points, such as SIFT or Harris operator, to the object region of interest to extract a plurality of feature points from the object region. Then, the vehicle control unit 33 may calculate the optical flow by identifying corresponding points in the object region in the past image for each of the plurality of feature points according to the applied tracking method. Alternatively, the vehicle control unit 33 may apply another tracking method applied to tracking a moving object detected from an image to the object region of interest in the latest image and the object region in the past image, thereby tracking the object represented in the object region.

[0041] The vehicle control unit 33 converts the coordinates in the image of each object being tracked into coordinates on the bird's-eye image (bird's-eye coordinates) by performing a viewpoint conversion process using information such as the mounting position of the camera 2 on the vehicle 10. At this time, the vehicle control unit 33 can estimate the position of the detected object at the time of acquiring each image based on the position and attitude of the vehicle 10 at the time of acquiring each image, the estimated distance to the detected object, and the direction from the vehicle 10 to the object. The position and attitude of the vehicle 10 at the time of acquiring each image may be estimated by comparing the image acquired by the camera 2 with a high-precision map. The vehicle control unit 33 can then estimate the predicted trajectory of the object up to a predetermined time ahead by performing a prediction process using a Kalman filter or a Particle filter on a series of bird's-eye coordinates.

[0042] The vehicle control unit 33 generates a planned driving route for the vehicle 10 based on the predicted trajectory of each object being tracked so that the predicted value of the distance between each of the objects being tracked and the vehicle 10 up to a predetermined time ahead is equal to or greater than a predetermined distance for each object. Furthermore, the vehicle control unit 33 refers to the current position of the vehicle 10 measured by a GPS receiver (not shown) and map information to determine whether or not the vehicle 10 needs to change lanes to move to the destination. If there is no need to change lanes, the vehicle control unit 33 generates a planned driving route by referring to the detected lane markings so that the vehicle 10 does not deviate from the lane in which the vehicle 10 is traveling. Furthermore, if there is a need to change lanes, the vehicle control unit 33 generates a planned driving route so that the vehicle 10 moves to a lane heading to the destination. Note that the vehicle control unit 33 may generate a plurality of planned driving routes. In this case, the vehicle control unit 33 may select a route from the plurality of planned driving routes that has the smallest sum of absolute values ​​of the acceleration of the vehicle 10.

[0043] When the vehicle control unit 33 sets the planned travel route, it controls each part of the vehicle 10 so that the vehicle 10 travels along the planned travel route. For example, the vehicle control unit 33 calculates a target acceleration of the vehicle 10 according to the planned travel route and the current vehicle speed of the vehicle 10 measured by a vehicle speed sensor (not shown), and sets the accelerator opening or brake amount so as to achieve the target acceleration. Then, the vehicle control unit 33 calculates a fuel injection amount according to the set accelerator opening, and outputs a control signal corresponding to the fuel injection amount to a fuel injection device of the engine of the vehicle 10. Alternatively, the vehicle control unit 33 calculates the amount of power to be supplied to a motor that drives the vehicle 10 according to the set accelerator opening, and controls a drive circuit of the motor so that the amount of power is supplied to the motor. Also, the vehicle control unit 33 outputs a control signal corresponding to the set brake amount to the brake of the vehicle 10.

[0044] Furthermore, when the vehicle 10 changes its course so that the vehicle 10 travels along a planned travel route, the vehicle control unit 33 determines a steering angle of the vehicle 10 according to the planned travel route. Then, the vehicle control unit 33 outputs a control signal corresponding to the steering angle to an actuator (not shown) that controls the steering of the vehicle 10.

[0045] Furthermore, when the vehicle control unit 33 is notified by the abnormality detection unit 32 that an abnormality or malfunction has occurred in the camera 2, the vehicle control unit 33 ends the automatic driving control and transfers the subject of driving control of the vehicle 10 to the driver of the vehicle 10. For this purpose, the vehicle control unit 33 notifies the driver that the subject of driving control will be transferred via a user interface (not shown) provided in the vehicle cabin of the vehicle 10. The user interface has, for example, at least one of one or more light sources or display devices provided in an instrument panel, a speaker, and a vibrator provided on a steering wheel or a driver's seat. The vehicle control unit 33 notifies the driver that the subject of driving control will be transferred by lighting or blinking one or more light sources in a predetermined pattern. Alternatively, the vehicle control unit 33 notifies the driver that the subject of driving control will be transferred by displaying a predetermined message or icon on the display device. Alternatively, the vehicle control unit 33 notifies the driver that the subject of driving control will be transferred by making the speaker output a predetermined sound or vibrate the vibrator in a predetermined pattern. The vehicle control unit 33 may notify the driver that the driving control will be handed over to the driver by using two or more of the above notification methods.

[0046] When a predetermined time has elapsed since starting to notify the driver of the transfer of driving control, the vehicle control unit 33 ends the automatic driving control of the vehicle 10. After the automatic driving control ends, the vehicle 10 is controlled according to the driving operation of the driver.

[0047] The update unit 34 updates the process registration information every time execution of any one of the multiple processes using the shared memory 241 is started or terminated. In the process registration information, for each process being executed using the shared memory 241, information indicating the priority of the process and the memory area in the shared memory 241 used by the process is registered. That is, when the update unit 34 receives process start information from the object detection unit 31 or the anomaly detection unit 32, it adds information indicating the priority of the process and the memory area of ​​the shared memory 241 used by the process to the process registration information. On the other hand, every time the update unit 34 receives a process end notification from the object detection unit 31 or the anomaly detection unit 32, it deletes information indicating the priority of the process that has finished execution and the memory area used by the process, which are indicated in the process end notification, from the process registration information.

[0048] Every time the update unit 34 updates the process registration information, it stores the updated process registration information in the memory 22. Furthermore, when the update unit 34 deletes the priority or the like related to a completed process from the process registration information, it notifies the process control unit 36 ​​of the completed process.

[0049] When a first process that is being executed or is about to be executed using the shared memory 241 rewrites data stored in the shared memory 241, the determination unit 35 refers to the process registration information. The determination unit 35 then determines whether or not a second process is being executed using the memory area of ​​the shared memory 241 used by the first process among the multiple processes. In this embodiment, when rewrite information is notified from the object detection unit 31, the determination unit 35 refers to the process registration information and determines whether or not an abnormality detection process is being executed using the memory area indicated in the notified rewrite information. In this case, the object detection process is an example of the first process. When a memory area used by the abnormality detection process being executed is registered in the process registration information, the determination unit 35 determines whether or not the registered memory area overlaps with the memory area indicated in the rewrite information notified from the object detection unit 31. When the memory area used by the anomaly detection process in progress overlaps at least partially with the memory area indicated in the rewrite information, the determination unit 35 determines that there is an anomaly detection process in progress that uses the memory area of ​​the shared memory 241 used by the object detection process. In this case, the anomaly detection process in progress is an example of the second process.

[0050] If no anomaly detection process currently being executed using shared memory 241 is registered in the process registration information, determination unit 35 determines that no anomaly detection process currently being executed using the memory area of ​​shared memory 241 used by the object detection process does not exist. Also, if the memory area used by the anomaly detection process currently being executed does not overlap with the memory area indicated in the rewrite information notified from object detection unit 31, determination unit 35 also determines that no anomaly detection process currently being executed using the memory area used by the object detection process does not exist.

[0051] Similarly, when the rewrite information is notified from the anomaly detection unit 32, the determination unit 35 refers to the process registration information and determines whether or not there is an object detection process being executed using the memory area indicated in the notified rewrite information. In this case, the anomaly detection process is an example of a first process. When the memory area used by the object detection process being executed is registered in the process registration information, the determination unit 35 determines whether or not the registered memory area overlaps with the memory area indicated in the rewrite information notified from the anomaly detection unit 32. Then, when at least a part of the memory area used by the object detection process being executed overlaps with the memory area indicated in the rewrite information, the determination unit 35 determines that there is an object detection process being executed using the memory area of ​​the shared memory 241 used by the anomaly detection process. In this case, the object detection process being executed is an example of a second process.

[0052] If no object detection process being executed using the shared memory 241 is registered in the process registration information, the determination unit 35 determines that no object detection process being executed using the memory area of ​​the shared memory 241 used by the anomaly detection process does not exist. Also, if the memory area used by the object detection process being executed does not overlap with the memory area indicated in the rewrite information notified from the anomaly detection unit 32, the determination unit 35 also determines that no object detection process being executed using the memory area used by the anomaly detection process does not exist.

[0053] Furthermore, when there is another process that uses the shared memory 241, the determination unit 35 may perform the same process as above to determine whether or not there is an object detection process or the like currently being executed using the memory area of ​​the shared memory 241 used by the other process. Similarly, the determination unit 35 may perform the same process as above to determine whether or not there is another process currently being executed using the memory area of ​​the shared memory 241 used by the object detection process or the anomaly detection process.

[0054] The determination unit 35 notifies the process control unit 36 ​​of the determination result as to whether or not a second process is being executed using the memory area of ​​the shared memory 241 used by the first process, and the priority of the first process and the second process.

[0055] The process control unit 36 ​​refers to the determination result notified by the determination unit 35. Then, if there is a second process having a higher priority than the first process, the process control unit 36 ​​suspends the first process until the second process is completed. Then, after the second process with the relatively higher priority is completed, the process control unit 36 ​​notifies the first process of a retry request to restart the first process from the beginning.

[0056] On the other hand, if there is a second process having a lower priority than the first process, the process control unit 36 ​​suspends the second process until the first process is completed. After the first process is completed, the process control unit 36 ​​notifies the second process of a retry request and causes the second process to be restarted from the beginning. In this way, the process control unit 36 ​​causes the relatively low priority process, whose execution has been suspended, to be re-executed after the relatively high priority process is completed, so that it is possible to prevent the relatively low priority process from being stopped.

[0057] In this embodiment, as described above, the priority of the anomaly detection process is higher than the priority of the object detection process. Therefore, when the object detection unit 31 attempts to write an image or intermediate data in a memory area of ​​the shared memory 241, if there is an anomaly detection process being executed by referring to that memory area, the execution of the object detection process is interrupted. That is, the process control unit 36 ​​causes the object detection unit 31 to interrupt the execution of the object detection process and causes the memory 22 to store a flag indicating that the object detection process is on hold. Then, when the process control unit 36 ​​is notified by the update unit 34 that the anomaly detection process has ended, it refers to the memory 22 and determines whether or not there is a flag indicating that the object detection process is on hold. If the flag is stored in the memory 22, the process control unit 36 ​​notifies the object detection unit 31 of a retry request and causes the object detection unit 31 to restart the object detection process from the beginning.

[0058] Conversely, when the anomaly detection unit 32 attempts to write a series of images or intermediate data in a memory area of ​​the shared memory 241, if there is an object detection process being executed by referring to that memory area, the execution of the object detection process is also interrupted. That is, the process control unit 36 ​​causes the object detection unit 31 to suspend the execution of the object detection process and causes the memory 22 to store a flag indicating that the object detection process is on hold. Then, when the process control unit 36 ​​is notified by the update unit 34 that the anomaly detection process has ended, it refers to the memory 22 and determines whether or not there is a flag indicating that the object detection process is on hold. If the flag is stored in the memory 22, the process control unit 36 ​​notifies the object detection unit 31 of a retry request and causes the object detection process to be restarted from the beginning. In this way, even if an object detection process with a relatively low priority is being executed, an anomaly detection process with a relatively high priority is executed without waiting for the object detection process to end.

[0059] Even if there is a process that uses the shared memory 241 other than the object detection process and the anomaly detection process, the process control unit 36 ​​may perform the same process as described above and give priority to the process with a relatively high priority.

[0060] FIG. 4 is a diagram for explaining an outline of the resource management process. In this example, there are four types of processes that use the shared memory 241. In FIG. 4, these four types of processes are represented as threads 1 to 4, respectively. The priority of each process decreases in the order of thread 2 → thread 1 → thread 3 → thread 4. That is, thread 2 has the highest priority and thread 4 has the lowest priority. In FIG. 4, the vertical axis represents elapsed time. Blocks 401 to 404 shown for each thread represent the period during which the calculation of that thread is being executed. In this example, threads 1 to 4 start to be executed in parallel at the same time t0. Then, thread 1 first refers to data stored in a memory area starting from address 0x10 of the shared memory 241. Next, thread 2 refers to a memory area starting from address 0x10 of the shared memory 241. Then, thread 2 rewrites data in the memory area starting from address 0x10 at time t1. Therefore, the execution of thread 1, which refers to the memory area in which data has been rewritten by thread 2 and has a priority lower than that of thread 2, is interrupted. Then, at time t3 when the execution of thread 2 ends, thread 1 is executed again from the beginning.

[0061] Furthermore, after thread 2 references the memory area starting at address 0x20, thread 3 attempts to rewrite the data in the memory area starting at address 0x20 at time t2. However, because the priority of thread 3 is lower than the priority of thread 2, the data in the memory area starting at address 0x20 is not rewritten, and at time t3 when the execution of thread 2 ends, thread 3 is executed again from the beginning.

[0062] Furthermore, while thread 4 is executing, it accesses a memory area starting at address 0x30 in shared memory 241, but this memory area does not overlap with memory areas referenced by other processes. Therefore, although the priority of thread 4 is lower than the priority of other processes, it is executed to the end without being interrupted.

[0063] 5 is an operational flowchart of the resource management process executed by the processor 24. The processor 24 may execute the resource management process in accordance with the following operational flowchart at predetermined intervals.

[0064] The update unit 34 of the processor 24 determines whether or not processing start information has been received from the object detection unit 31 or the abnormality detection unit 32 (step S101). If the update unit 34 has received the processing start information (step S101-Yes), the update unit 34 reads the processing registration information from the memory 22. Then, the update unit 34 adds the priority of the processing to be started and the memory area to be used in the shared memory 241, which are indicated in the processing start information, to the processing registration information (step S102).

[0065] After step S102, or if the update unit 34 has not received the processing start information (step S101-No), the update unit 34 determines whether or not a processing end notification has been received from the object detection unit 31 or the anomaly detection unit 32 (step S103). If the update unit 34 has received the processing end notification (step S103-Yes), it reads out the processing registration information from the memory 22. Then, the update unit 34 deletes information indicating the priority and the memory area to be used for the processing notified of the end in the processing end notification (in this example, the object detection processing or the anomaly detection processing) from the processing registration information (step S104). Furthermore, the processing control unit 36 ​​of the processor 24 determines whether or not a waiting process exists (step S105). If a waiting process exists (step S105-Yes), the processing control unit 36 ​​notifies a retry request to execute the waiting process (step S106).

[0066] After step S106, the determination unit 35 of the processor 24 determines whether or not rewrite information has been received from the object detection unit 31 or the anomaly detection unit 32 (step S105). Also, if the update unit 34 has not received a processing end notification (step S103-No) or if there is no waiting processing (step S105-No), the determination unit 35 determines whether or not rewrite information has been received (step S107).

[0067] When the determination unit 35 receives the rewrite information (step S107-Yes), the determination unit 35 refers to the process registration information and determines whether or not there is another process (second process) being executed using the memory area that the process (first process) indicated by the identification information included in the rewrite information is to rewrite (step S108).

[0068] If the second process exists (step S108-Yes), the process control unit 36 ​​refers to the process registration information and determines whether the priority of the first process is lower than the priority of the second process (step S109). If the priority of the first process is lower than the priority of the second process (step S109-Yes), the process control unit 36 ​​notifies the object detection unit 31 of the interruption of the first process (step S110). For example, if the first process is an object detection process and the second process is an abnormality detection process, the process control unit 36 ​​notifies the object detection unit 31 of the interruption of the object detection process.

[0069] On the other hand, if the priority of the first process is higher than the priority of the second process (step S109-No), the process control unit 36 ​​notifies the interruption of the second process being executed (step S111). For example, if the first process is an abnormality detection process and the second process is an object detection process, the process control unit 36 ​​notifies the object detection unit 31 of the interruption of the object detection process. Then, the process control unit 36 ​​notifies that rewriting of the memory area by the first process is permitted (step S112).

[0070] Also, in step S108, if the second process does not exist (step S108-No), the process control unit 36 ​​notifies that rewriting of the memory area by the first process is permitted (step S112).

[0071] After step S110 or S112, the processor 24 ends the resource management process.

[0072] As described above, the resource management device uses the process registration information to manage the priority of a process that is being executed using a shared resource among multiple processes and the range of the shared resource that the process uses. That is, when a first process that is being executed using the shared resource rewrites data stored in the shared resource, the resource management device refers to the process registration information. Then, the resource management device determines whether or not a second process that is being executed using the range of the shared resource that the first process uses exists. When a second process that has a higher priority than the priority of the first process exists, the resource management device suspends the first process until the second process ends. On the other hand, when a second process that has a lower priority than the priority of the first process exists, the resource management device suspends the second process until the first process ends. Therefore, when multiple processes that use a shared resource compete for the use of the shared resource, the resource management device can guarantee that the process with the higher priority among the multiple processes is executed preferentially.

[0073] This resource management device may be applied to systems other than vehicle control systems, etc. This resource management device can be applied to various devices or systems in which multiple processes are executed by allocating shared resources to the multiple processes that are asynchronous with each other and have assigned priorities.

[0074] As described above, those skilled in the art can make various modifications to the embodiments within the scope of the present invention. [Explanation of symbols]

[0075] 1 Vehicle Control System 2 Camera 3. Electronic control unit (resource management unit) 21 Communication Interface 22 Memory 23 Buffer Memory 24 processors 31 Object detection unit 32 Anomaly detection section 33 Vehicle control unit 34 Update section 35 Judgment section 36 Processing control section

Claims

1. a storage unit that stores process registration information that indicates a priority of a process that is being executed using a shared resource among a plurality of processes and a range of the shared resource that is being used by the process that is being executed; an update unit that updates the process registration information so that, each time execution of any one of the plurality of processes is started, the priority and the range of the process are added to the process registration information, and, on the other hand, each time utilization of the shared resource for any one of the plurality of processes is ended, the priority and the range of the process are deleted from the process registration information; a determination unit that, when a first process among the plurality of processes that is being executed using the shared resource rewrites data stored in the shared resource, determines whether or not a second process among the plurality of processes that is being executed using a range of the shared resource used by the first process exists, by referring to the process registration information; a process control unit that, when the second process having a higher priority than the first process exists, suspends the first process until the second process is completed, and, when the second process having a lower priority than the first process exists, suspends the second process until the first process is completed; A resource management device having the following.

2. 2. The resource management device according to claim 1, wherein the processing control unit, when interrupting the first process, causes the first process to be re-executed from the beginning when the second process, which has a higher priority than the first process, is terminated.

3. 3. A resource management device as described in claim 1 or 2, wherein one of the plurality of processes is an object detection process that detects a specified object represented in a sensor signal generated by the sensor, and another of the plurality of processes is an anomaly detection process that detects an abnormality or malfunction occurring in the sensor, and the priority of the anomaly detection process is set higher than the priority of the object detection process.

4. each time execution of any one of a plurality of processes is started, a priority of that process and a range of the shared resource used by that process are added to process registration information stored in a storage unit, the process registration information representing a priority of a process among the plurality of processes currently being executed using the shared resource and a range of the shared resource used by that currently being executed process, and on the other hand, each time utilization of the shared resource for any one of the plurality of processes is ended, the process registration information is updated so as to delete the priority and the range of that process from the process registration information; when a first process among the plurality of processes that is being executed using the shared resource rewrites data stored in the shared resource, referring to the process registration information, determining whether or not a second process among the plurality of processes that is being executed using a range of the shared resource used by the first process exists; If there is a second process having a higher priority than the first process, suspending the first process until the second process is completed; If there is a second process having a lower priority than the first process, the second process is suspended until the first process is completed. A resource management method comprising:

5. each time execution of any one of a plurality of processes is started, a priority of that process and a range of the shared resource used by that process are added to process registration information stored in a storage unit, the process registration information representing a priority of a process among the plurality of processes currently being executed using the shared resource and a range of the shared resource used by that currently being executed process, and on the other hand, each time utilization of the shared resource for any one of the plurality of processes is ended, the process registration information is updated so as to delete the priority and the range of that process from the process registration information; when a first process among the plurality of processes that is being executed using the shared resource rewrites data stored in the shared resource, referring to the process registration information, determining whether or not a second process among the plurality of processes that is being executed using a range of the shared resource used by the first process exists; If there is a second process having a higher priority than the first process, suspending the first process until the second process is completed; If there is a second process having a lower priority than the first process, the second process is suspended until the first process is completed. A computer program for managing resources to cause a computer to do things.

Citation Information

Patent Citations

  • Controlling device of shared resource

    JP1985101666A

  • Information processor

    JP1999194951A

  • Method and apparatus for scheduling instruction issuance in a multithreaded microprocessor

    JP2012525620A

  • Access control apparatus, access control program, and access control method

    WO2009157136A1