CN-116126560-B - Message processing method, device and storage medium
Abstract
The application discloses a message processing method, a message processing device and a storage medium. Taking an example that the method is applied to electronic equipment with processing capability, the method specifically comprises the steps that the electronic equipment obtains data to be processed, and then, a first state machine is operated according to the data to be processed. The first state machine comprises a first sub-state machine and a plurality of second sub-state machines, the states in the first sub-state machine comprise states shared by a plurality of application tasks, one second sub-state machine comprises a state of one application task, and the states included by different second sub-state machines are different. The method is used for solving the problem that the function integration realized based on the state machine can cause the intersection and conflict of the operation control time sequence.
Inventors
- HU WEILONG
- QIAN HUIJIA
- LI JUNNAN
- Ni Gaoshang
Assignees
- 宁波吉利汽车研究开发有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230207
Claims (9)
- 1. A method of message processing comprising: Acquiring data to be processed, wherein the data to be processed comprises state information of a plurality of automatic driving auxiliary functions; according to the data to be processed, a first state machine is operated, the first state machine comprises a first sub-state machine and a plurality of second sub-state machines which are operated in parallel, the states in the first sub-state machine comprise states shared by a plurality of application tasks, the states in one second sub-state machine comprise states of one application task after all the states of the shared states are removed, the states included in different second sub-state machines are different, and the states included in the second sub-state machines are circulated according to a directed acyclic execution sequence; A sub-state machine and a thread binding, states and co Cheng Bang within one of said sub-state machines, running said first state machine, comprising: Running a first thread bound with the first sub-state machine to process a state common to state information of the plurality of automatic driving auxiliary functions, and transmitting the states held by the plurality of automatic driving auxiliary functions in the data to be processed by the first sub-state machine to a second thread bound with a corresponding second sub-state machine to process the states; And driving the corresponding automatic driving auxiliary function according to the processing result of the second thread to generate a corresponding vehicle control instruction so as to control the vehicle.
- 2. The method of claim 1, wherein prior to acquiring the data to be processed, the method further comprises: respectively acquiring all states of each application task in the plurality of application tasks; Determining a state shared by the plurality of application tasks according to all the states of the application tasks, and determining a state of each application task independently; And determining the first sub-state machine and the second sub-state machines according to the state shared by the application tasks and the tasks independently possessed by each application task.
- 3. The method of claim 2, wherein determining the first sub-state machine and the plurality of second sub-state machines based on a state common to the plurality of application tasks and a state independently possessed by each application task comprises: And determining the first sub-state machine and the second sub-state machines according to a system configuration file, a state shared by the application tasks and a state independently possessed by each application task, wherein the system configuration file is used for indicating the execution sequence of the states corresponding to each application task.
- 4. The method of claim 3, wherein prior to running the first state machine, the method further comprises: Reading the topological order of each second sub-state machine from the system configuration file, wherein the topological order is used for indicating the execution sequence of the states; updating the topological order of at least one second sub-state machine, and generating a new system configuration file according to the updated topological order.
- 5. A message processing apparatus, comprising: The system comprises an acquisition module, a processing module and a control module, wherein the acquisition module is used for acquiring data to be processed, and the data to be processed comprises state information of a plurality of automatic driving auxiliary functions; The running module is used for running a first state machine according to the data to be processed, wherein the first state machine comprises a first sub-state machine and a plurality of second sub-state machines running in parallel, the states in the first sub-state machine comprise a state shared by a plurality of application tasks, the states in one second sub-state machine comprise a state after all states of one application task are removed from the shared state, the states in different second sub-state machines are different, the states in the second sub-state machine are circulated according to a directed and loop-free execution sequence, one sub-state machine is bound with one thread, the states in one sub-state machine are bound with one thread, the running of the first state machine comprises running the states shared by the state information of the plurality of automatic driving auxiliary functions processed by the first thread bound with the first sub-state machine, the states of the plurality of automatic driving auxiliary functions in the data to be processed are processed by the first sub-state machine, the states of the plurality of automatic driving auxiliary functions are respectively bound with the corresponding second thread to the second thread to generate corresponding driving control instructions of the vehicle driving auxiliary function, and the driving control instruction is correspondingly processed by the second thread to the corresponding to the second thread.
- 6. The apparatus of claim 5, wherein the acquisition module is further to: respectively acquiring all states of each application task in the plurality of application tasks; Determining a state shared by the plurality of application tasks according to all the states of the application tasks, and determining a state of each application task independently; And determining the first sub-state machine and the second sub-state machines according to the state shared by the application tasks and the tasks independently possessed by each application task.
- 7. The apparatus of claim 6, wherein the acquisition module is specifically configured to: And determining the first sub-state machine and the second sub-state machines according to a system configuration file, a state shared by the application tasks and a state independently possessed by each application task, wherein the system configuration file is used for indicating the execution sequence of the states corresponding to each application task.
- 8. An electronic device comprising a processor and a memory communicatively coupled to the processor; The memory stores computer-executable instructions; The processor executes computer-executable instructions stored in the memory to implement the method of any one of claims 1-4.
- 9. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any one of claims 1-4.
Description
Message processing method, device and storage medium Technical Field The present application relates to the field of computer technologies, and in particular, to a method and apparatus for processing a message, and a storage medium. Background The automatic driving system of the vehicle involves many automatic driving support functions, for example, an adaptive cruise control (adaptive cruise control, ACC) function, a lane keeping support (LANE KEEPING ASSISTANCE, LKA) function, an automatic emergency brake (autonomous emergency braking, AEB) function, an automatic parking support (APA) function, and the like of the vehicle, and involves many complex algorithms based on a state machine. Currently, autopilot assistance functions are designed integrally, e.g., ACC and AEB functions are both related to driving, and may be designed integrally. Along with the trend of diversification of functions of an automatic driving system, the integration level of automatic driving auxiliary functions is higher and higher, and the functional integration realized based on a state machine can cause the intersection and conflict of operation control time sequences, so that the functions are disordered, and the safety is lower. Disclosure of Invention The application provides a message processing method, a message processing device and a storage medium, which are used for solving the problem that the integration of automatic driving auxiliary functions is higher and higher, and the function integration realized based on a state machine can cause the intersection and conflict of operation control time sequences. In a first aspect, the present application provides a message processing method. Taking an example that the method is applied to electronic equipment with processing capability, the method specifically comprises the steps that the electronic equipment obtains data to be processed, and then, a first state machine is operated according to the data to be processed. The first state machine comprises a first sub-state machine and a plurality of second sub-state machines, the states in the first sub-state machine comprise states shared by a plurality of application tasks, one second sub-state machine comprises a state of one application task, and the states included by different second sub-state machines are different. In the embodiment of the application, the state shared by all the automatic driving auxiliary functions is processed by a first sub-state machine, and each second sub-state machine processes the independent state of the corresponding automatic driving auxiliary function. Since the common state is pulled, the different second sub-state machines comprise different states, i.e. there is no crossing of the states of the different second sub-state machines. That is, the first sub-state machine and each second sub-state machine can ensure that the states of each automatic driving auxiliary function are not crossed, so that the crossing and the collision of the operation control time sequences of the automatic driving system can be avoided as much as possible, and the operation stability of the automatic driving system is improved. Optionally, before acquiring the data to be processed, the method further includes the step of the electronic device acquiring all states of each of the plurality of application tasks. Then, a state common to a plurality of application tasks is determined from all the states of the respective application tasks, and a state independently possessed by each application task is determined. And then, determining a first sub-state machine and a plurality of second sub-state machines according to the state shared by the plurality of application tasks and the tasks independently possessed by each application task. Optionally, determining the first sub-state machine and the plurality of second sub-state machines according to the state common to the plurality of application tasks and the state independently possessed by each application task includes determining the first sub-state machine and the plurality of second sub-state machines according to the system configuration file, the state common to the plurality of application tasks and the state independently possessed by each application task. The system configuration file is used for indicating the execution sequence of the states corresponding to the application tasks. Optionally, before running the first state machine, the method further comprises reading a topology ordering of the respective second sub-state machines from the system configuration file, the topology ordering being used to indicate an order of execution of the states. Then, the topology ordering of the at least one second sub-state machine is updated, and a new system configuration file is generated according to the updated topology ordering. The topology sequence of each second sub-state machine is stored in the system configuration file, and when the topology sequence of each se