CN116149761A - Method and device for realizing vehicle-end rule engine, electronic equipment and storage medium - Google Patents

Method and device for realizing vehicle-end rule engine, electronic equipment and storage medium Download PDF

Info

Publication number
CN116149761A
CN116149761A CN202211524428.7A CN202211524428A CN116149761A CN 116149761 A CN116149761 A CN 116149761A CN 202211524428 A CN202211524428 A CN 202211524428A CN 116149761 A CN116149761 A CN 116149761A
Authority
CN
China
Prior art keywords
rule
event
vehicle
state
signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211524428.7A
Other languages
Chinese (zh)
Inventor
王超
阳雨
高方泽
何星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202211524428.7A priority Critical patent/CN116149761A/en
Publication of CN116149761A publication Critical patent/CN116149761A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4498Finite state machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5011Pool

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Traffic Control Systems (AREA)

Abstract

The embodiment of the application provides a method and a device for realizing a vehicle-end rule engine, electronic equipment and a storage medium. The method for realizing the vehicle-end rule engine comprises the following steps: synchronizing rule information of cloud configuration, and updating local rule information based on the rule information of the cloud configuration; monitoring and acquiring the vehicle state in real time based on the SOA architecture; judging whether the vehicle state meets the local rule information or not; if the condition is satisfied, that is, a predefined scene state is reached, a determination event of the rule engine is output to the outside. According to the technical scheme, the state signal of the vehicle can be converted into the scene event focused by the user aiming at the demand scene focused by the user.

Description

Method and device for realizing vehicle-end rule engine, electronic equipment and storage medium
Technical Field
The application relates to the technical field of intelligent automobiles, in particular to a method and a device for realizing a vehicle-end rule engine, electronic equipment and a storage medium.
Background
Along with the gradual development of the automobiles towards intellectualization and electrodynamic performance, the data volume related to the automobiles is exponentially increased, and how to process the automobile data and display the automobile state in real time and feed back the automobile state to users becomes an increasingly needed problem in the industry. The vehicle data relates to vehicle state information, vehicle event information, environment information, user state information and the like, and the acquisition, processing, identification and transmission of the data information are one of main research contents of future automobile intellectualization. The SOA is a service-oriented architecture, is a software design idea, and is the basis of future software-defined automobiles. In the SOA architecture, the service is an abstract means of the whole system, is a most basic unit of the system, and each domain serves the own capability and provides a unified interface for a third party to use.
The chinese patent document with publication number CN113886385a discloses a technology named "new energy automobile insurance representation identification method and device based on rule engine", based on whether the input information of the rule engine is the notice model data and the power type data of the vehicle and the output information is the new energy automobile identifier. The technology has a narrow application field, can not process a large number of vehicle signals of the existing intelligent automobile, and can not be applied to the field of identifying events of interest of a user according to the state of the automobile.
The chinese patent document with publication number CN114495057a discloses a technology named "data collection method, electronic device and storage medium", which generates a data collection task according to a data collection requirement input by a user, configures a data collection rule and a data collection action, when the data collection rule is attributed to a vehicle-end rule engine, issues the data collection task to a target terminal device, and when the vehicle-end rule engine determines that a trigger condition of the data collection rule is satisfied, executes the data collection action to collect target data. The technology only provides a logic method for data acquisition by the vehicle-end rule engine, does not specify a specific design method of the vehicle-end rule engine, does not specify a method for acquiring or monitoring vehicle signals, and cannot set rules and judge rules for a certain predefined scene.
The existing vehicle-end rule engine has the following problems:
the first rule engine is deployed on the platform of the non-vehicle end, and the application cases and the technical schemes of the first rule engine and the rule engine are fewer, and most of the rule engines are applied to other fields or industries or are deployed on the platform of the non-vehicle end;
secondly, the description of the rule engine at the vehicle end is less in the prior patent, and most of the rule engine is only used as an internal module of a specific application system, and the specific design method and implementation mode of the rule engine are not elaborated;
thirdly, the existing vehicle-end rule engine does not aim at a demand scene focused by a user, and converts a state signal of the vehicle into a scene event focused by the user;
disclosure of Invention
In order to solve the technical problems, embodiments of the present application provide a method and apparatus for implementing a vehicle-end rule engine, an electronic device, and a storage medium, so as to implement a requirement scene focused by a user, and convert a status signal of a vehicle into a scene event focused by the user.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned in part by the practice of the application.
According to an aspect of the embodiment of the application, there is provided a method for implementing a vehicle-end rule engine, including: synchronizing rule information of cloud configuration, and updating local rule information based on the rule information of the cloud configuration; monitoring and acquiring the vehicle state in real time based on the SOA architecture; judging whether the vehicle state meets the local rule information or not; if the condition is satisfied, that is, a predefined scene state is reached, a determination event of the rule engine is output to the outside.
In the technical scheme provided by the embodiment of the application, the rule information of the cloud configuration is synchronized, and the local rule information is updated based on the rule information of the cloud configuration, including:
acquiring rule information of the cloud configuration;
updating the local rule information based on the rule information configured by the cloud;
analyzing the updated rule information into a memory;
registering or deregistering the monitored event signals and registering or deregistering the service state calling signals according to the signal types of different triggering conditions of the rule information after updating.
In the technical scheme provided by the embodiment of the application, the method for monitoring and acquiring the vehicle state in real time based on the SOA architecture comprises the following steps:
monitoring event class signals or polling state class signals;
judging whether the event type signal or the state type signal needs smoothing processing, and if so, adopting a mode of calculating an average value/a moving average value/multi-point sampling to process;
and recording the event type signal or the state type signal after the buffer smoothing processing.
In the technical solution provided in the embodiments of the present application, monitoring an event class signal includes: and when the event type signal changes, recording a signal value through a registered callback function.
In the technical solution provided in the embodiments of the present application, the polling state class signal includes: polling the state type signal by using a thread pool, wherein the thread pool has an upper limit of thread quantity; and the thread pool records the thread information of the blocking signals, opens up a corresponding number of new threads to acquire the state type signals until the blocking threads are released, and destroys the new threads.
In the technical solution provided in the embodiments of the present application, determining whether the vehicle state satisfies the local rule information, if so, that is, a predefined scene state is reached, and outputting a determination event of the rule engine to the outside includes:
when the signal is changed, traversing the related rules according to the signal types to judge whether the rules are satisfied, and inquiring the event to which the rules belong if the rules are satisfied;
traversing an event to be decided, and judging whether other rules exist in the event;
if yes, inquiring the other rule signal values;
if the other rules are successfully matched, event anti-shake judgment is carried out;
and if the event anti-shake condition is met, sending the event code corresponding to the rule to the outside.
In the technical solution provided in the embodiments of the present application, determining whether the vehicle state meets the local rule information, if so, that is, a predefined scene state is achieved, outputting a determination event of the rule engine to the outside, and further including:
Timing rule ascending order, and obtaining the current system time;
traversing time rules, and setting a timer according to the time difference between the system time and the time rules;
after the timer is awakened, inquiring an event corresponding to the time rule;
traversing an event to be decided, and judging whether other rules exist in the event;
inquiring the other rule signal values;
if the other rules are successfully matched, event anti-shake judgment is carried out;
and if the event anti-shake condition is met, sending the event code corresponding to the rule to the outside.
In the technical solution provided in the embodiment of the present application, the rule information includes a trigger rule, an arbitration condition, and event information, where the rule information includes ruleType, name, signalCode, opera, constValue, needSmooth, arbitration, arbitrationValue, eventCode fields, six fields form the trigger rule, a rule type of the trigger rule indicates a trigger rule type, name indicates a trigger rule interpretation, signalCode indicates a signal type, opera indicates a comparison type, constValue indicates a comparison value, and needledschoth indicates whether an acquired signal needs smoothing processing; the Arbitrate of the Arbitration condition represents an anti-shake type, and the Arbitrate value represents an anti-shake value; eventCode represents event information.
According to an aspect of the embodiments of the present application, there is provided a vehicle-end rule engine implementation apparatus, including:
the rule distribution module is used for synchronizing rule information of cloud configuration and updating local rule information based on the rule information of the cloud configuration;
the state machine module is used for monitoring and acquiring the vehicle state in real time based on the SOA architecture;
and the event arbitration module is used for judging whether the vehicle state meets the local rule information or not, and if so, the event arbitration module reaches a predefined scene state and outputs the judging event of the rule engine to the outside.
According to an aspect of an embodiment of the present application, there is provided an electronic device including:
one or more processors;
and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic equipment realizes the vehicle-end rule engine realization method.
According to an aspect of the embodiments of the present application, there is provided a computer-readable storage medium having stored thereon computer-readable instructions, which when executed by a processor of a computer, cause the computer to perform the above-described vehicle-end rule engine implementation method.
According to an aspect of the embodiments of the present application, there is also provided a computer program product, including a computer program, which when executed by a processor implements the above-mentioned vehicle end rule engine implementation method.
In the technical schemes provided by some embodiments of the present application, a rule engine implementation method deployed on a vehicle-end platform is provided, and specific design is performed for the limitation of vehicle-end platform resources, so that the platform resource consumption is reduced under the condition of ensuring real-time performance as much as possible; based on an SOA service-oriented architecture, a state machine mechanism is established at a vehicle end, and the vehicle state can be monitored in real time and effectively based on the integrated and abstract service capability of the vehicle end; the proposed vehicle-end rule engine can conduct targeted monitoring to obtain the vehicle state according to the concerned rule base information issued by the cloud, the rule base supports the cloud to be configurable, the vehicle-end monitoring signals support the dynamic increase and decrease, and the performance consumption problem caused by the total monitoring of the vehicle-end signals is avoided; the proposed vehicle-end rule engine can complete the processing of time signals in the rule base, and can monitor and judge the combination of vehicle signals and time signals; the vehicle-end rule engine can cooperate with an external module, such as scene arrangement, data acquisition and the like, and can be used as a trigger end to trigger the external module to execute corresponding functions, so that the problems of vehicle state identification and user attention event identification can be effectively solved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art. In the drawings:
FIG. 1 is a logical diagram of a vehicle end rules engine shown in an exemplary embodiment of the present application;
FIG. 2 is a flowchart of an overall vehicle end rules engine shown in an exemplary embodiment of the present application;
FIG. 3 is a flow chart of a rule distribution module shown in an exemplary embodiment of the present application;
FIG. 4 is a state machine module flow diagram shown in an exemplary embodiment of the present application;
FIG. 5 is a flow chart of an event arbitration module shown in an exemplary embodiment of the present application;
fig. 6 is a schematic diagram illustrating rule information composition according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
It should be noted that SOA (Service-oriented architecture) is a method for designing, developing, deploying and managing discrete models in a computer environment. SOA is not a freshness and is proposed in the context of in-enterprise IT system re-construction and inefficiency. In the SOA model, all functions are defined as independent services, all services being connected through a service bus (ESB) or flow manager. This loosely coupled architecture enables integration of the various heterogeneous systems already present at minimal cost, and of course introduces more complexity itself due to the need to implement adaptations to the various heterogeneous systems (ESBs are typically used to accomplish protocol conversions and data format conversions between the different systems).
The design principle of the SOA comprises the following steps: explicit interface definition: the interface needs to meet the requirements of stability, definition, encapsulation and the like. Self-contained and modular: the functional entity for realizing the service is completely independent and autonomous, and is independently deployed, version controlled, self-managed and recovered. Coarse particle size: the number of services should not be too large, relying on message interactions rather than remote procedure calls. Loose coupling: the interdependence and influence among the services are reduced, and the positions, implementation technologies, current states and private data of the services are invisible to the service requesters. Interoperability, compatibility, and policy declaration. SOA is a concept and idea of architecture design that needs to be implemented by specific technologies and methods. The mainstream implementation method of the SOA at present comprises the following steps: web Service, service registry, and enterprise Service bus.
Rule engine: when the complex service is developed, the logic codes and the service codes of the program are mutually nested and complicated, and meanwhile, the maintenance cost is high and the expansibility is poor. The rule engine is: component! The rule engine is actually an inference engine that matches the facts and rules to draw conclusions.
Thread pool: the advantage of the thread pool reduces the system resource consumption, and reduces the consumption caused by thread creation and destruction by reusing the existing threads; the response speed of the system is improved, and when a task arrives, the task can be immediately executed without waiting for the creation of a new thread; the control of the concurrent number of the threads is facilitated, if the threads are created without limitation, a large amount of system resources can be additionally consumed, and the conditions of blocking the system or insufficient memory and the like due to excessive occupation of the resources are further met, so that the stability of the system is reduced. The thread pool can effectively control threads, uniformly allocate and regulate, and provide resource utilization rate; the thread pool has more powerful functions, provides a thread pool with functions of timing, periodical and controllable thread number, and the like, and is convenient and simple to use.
In the embodiment, a rule engine is deployed on a vehicle-end platform, and limitation of vehicle-end performance resources is fully considered to explain design ideas and implementation modes of the rule engine in detail; and aiming at the requirement scene focused by the user, the vehicle-end rule engine can cooperate with an external three-party module, such as a vehicle-end scene arrangement application, a data acquisition application and the like, and when the rule engine monitors that the vehicle meets a certain state or data acquisition rule preset by the user, the corresponding service arrangement scene or data acquisition scene can be triggered.
The vehicle-end rule engine analyzes the rule information according to the rule information configured by the cloud end, monitors and acquires the vehicle state in real time based on the SOA architecture, forms a vehicle state machine mechanism at the vehicle end, judges whether the current vehicle state meets the rule information configured in advance in real time, and if so, indicates that the rule information reaches the scene state defined in advance, and outputs a judging event of the rule engine to the outside.
The embodiment mainly comprises three modules: rule distribution module, state machine module, event arbitration module.
Rule distribution module: and the module is responsible for synchronizing rule information configured by the cloud to the vehicle end and comprises rule storage and rule updating functions. The rule storage function is to store and analyze rule information at the vehicle end, and a plurality of rule information form a rule base to support the operation of adding, deleting and checking the rule base. The rule updating refers to pulling the cloud rule information to the vehicle end, and realizing active or passive updating after the cloud rule is changed.
A state machine module: and the vehicle state monitoring system is responsible for monitoring and acquiring vehicle state signals and recording the vehicle state in real time as a vehicle end state machine. The module divides the vehicle signals into event signals and state signals, obtains the vehicle signals through external services based on an SOA architecture, processes the signals correspondingly, and stores the signals in a state machine to serve as a basis for matching with rule information.
Event arbitration module: and judging whether the rule information is satisfied, and if so, outputting event information. The module comprises signal judgment, event decision and event anti-shake functions. The signal judgment is to judge whether the corresponding signal rules are matched or not according to the acquired vehicle signals by the pointer pair. The event decision is to judge whether all the signal rules corresponding to the event are matched. The event anti-shake is characterized in that the pointer has large data quantity and rapid signal change on the vehicle signal, and the event triggered repeatedly in a short time is filtered and smoothed to prevent event storm.
The vehicle-end rule engine is used for acquiring and monitoring vehicle signals and data, identifying and judging whether rule information in a rule base is matched according to predefined rules, and outputting the matched information. The rule engine can solve the problem that the vehicle-end data is complex and tedious, so that the specific scene cannot be subjected to the imaging processing. The rule engine can integrate and abstract information focused by a specific scene into a specific output, can sense the specific state of the vehicle more clearly, and can grasp whether the vehicle is in an abnormal state or not specifically and in real time.
The technical scheme of the embodiment of the application relates to SOA (service oriented architecture) and other technologies, and is specifically described through the following embodiments:
FIG. 1 is a logical diagram of a vehicle end rules engine as illustrated in an exemplary embodiment of the present application.
FIG. 2 is a flow diagram illustrating an overall vehicle end rules engine according to an exemplary embodiment of the present application.
Referring to fig. 1 and fig. 2, the present embodiment provides a method for implementing a rule engine at a vehicle end, including: synchronizing rule information of cloud configuration, and updating local rule information based on the rule information of the cloud configuration; monitoring and acquiring the vehicle state in real time based on the SOA architecture; judging whether the vehicle state meets the local rule information or not; if the condition is satisfied, that is, a predefined scene state is reached, a determination event of the rule engine is output to the outside. Namely: s201, synchronizing a cloud rule information base, updating a local information base, and registering/deregistering monitoring signals; s202, monitoring and acquiring a vehicle signal, and performing smoothing treatment on the signal; s203, judging rule matching information, and carrying out event arbitration judgment; s204, sending event codes to the external module. In the embodiment, firstly, a vehicle-end rule engine synchronizes rule base information configured by a cloud end, and synchronously updates a local rule base file and rule base information analyzed in a memory; then according to the updated rule base information, registering or canceling the monitored corresponding vehicle signals; the state machine divides the registered signals into event signals and state signals, acquires the event signals through external callback, polls and acquires the state signals, judges whether smoothing is needed for the acquired signals, and then caches the acquired signals into the state machine; when the vehicle signal in the state machine changes, judging rule matching information, when all trigger rules corresponding to a certain rule are successfully matched, judging the event by arbitration, and transmitting event codes to the outside by arbitration.
FIG. 3 is a flow chart of a rule distribution module shown in an exemplary embodiment of the present application.
Referring to fig. 3, synchronizing rule information of a cloud configuration, and updating local rule information based on the rule information of the cloud configuration includes: acquiring rule information of the cloud configuration; updating the local rule information based on the rule information configured by the cloud; analyzing the updated rule information into a memory; registering or deregistering the monitored event signals and registering or deregistering the service state calling signals according to the signal types of different triggering conditions of the rule information after updating. Namely: s301, starting the system, S302, updating cloud rules, S303, acquiring cloud rule base information, S304, updating (adding, deleting and modifying) a local file rule base, S305, analyzing the local file rule base, modifying analysis information in a memory, S306, and monitoring or calling a registration/cancellation service state according to signal types of different trigger conditions by registering/cancellation events. The module is responsible for completing rule storage and rule updating functions. Rule storage includes rule base file storage and rule base parsing into memory information storage, involving in specific operations the addition, deletion, modification and querying of rule bases. The rule updating enables the rule base of the vehicle end to be consistent with the rule base of the cloud end, wherein the rule updating comprises two updating modes of actively requesting to update the rule base of the vehicle end (actively updating the vehicle end) and actively sending the updated rule base to the vehicle end by the cloud end (passively updating the vehicle end).
When the rule engine of the vehicle end is started, the vehicle end adopts an active updating mode to update the local rule base; and after the cloud rule base is changed, the vehicle end updates the local rule base in a passive updating mode. After the cloud rule base information is acquired by the vehicle end, the local file rule base information is updated, and the updated rule information is analyzed and stored in the memory.
The vehicle-end rule engine provided by the embodiment is implemented based on an SOA architecture, and needs to register or monitor for the vehicle-end signals, so that after the vehicle-end rule base is updated, the monitored event signals are required to be registered or logged out according to the updated rule, and the service state calling signals are required to be registered or logged out.
FIG. 4 is a flow chart of state machine modules shown in an exemplary embodiment of the present application.
Referring to fig. 4, the SOA architecture-based real-time monitoring and acquiring of the vehicle state includes: monitoring event class signals or polling state class signals; judging whether the event type signal or the state type signal needs smoothing processing, and if so, adopting a mode of calculating an average value/a moving average value/multi-point sampling to process; and recording the event type signal or the state type signal after the buffer smoothing processing. Namely: s401, starting a state machine, S402, monitoring a vehicle-end event signal, S403, polling a vehicle-end state signal, S404, judging whether the signal needs smoothing processing, if so, adopting methods of calculating an average value/moving average value/multipoint adoption and the like to process, S405, recording the vehicle-end signal in the state machine. The module completes the signal recording and maintenance functions of the vehicle-end state machine based on the configured vehicle-end rule base information. The module divides the vehicle-end signal into event signals and state signals, and real-time records are respectively carried out according to the characteristics of the two signals. Because the event signals can send the change information of the event signals to the external module, the state machine only needs to register the event signals, and when the event signals change, the state machine can automatically record the signal values through a registered callback function.
Since the status type signal does not transmit signal change information to the outside, the signal value cannot be recorded by the external callback. And in the state machine, aiming at the vehicle-end state signals, adopting a timing polling mode to process. Considering the real-time property of the timing polling and the consumption of resources, the module mainly performs trade-off processing in the two, and adopts a thread pool to poll the status type signals on a specific implementation. For resource consumption, the thread pool has an upper limit on the number of threads; aiming at the real-time property of the state machine record signal, considering the complex hardware environment of the vehicle-end signal, the blocking condition of the acquired signal can be considered, so that the acquisition of other signals can be possibly caused, the thread information of the blocking signal can be recorded in a thread pool, if the blocking thread exists, the state signal acquisition is automatically carried out by opening up a corresponding number of new threads until the blocking thread is released, and then the threads of the corresponding number of acquired state signals are destroyed.
For the obtained event or state signal, the state machine judges whether smoothing processing is needed according to the configuration information of the signal, and if the smoothing processing is needed, the state machine processes the event or state signal in a mode of calculating an average value/moving average value and performing multi-point sampling. The smoothing processing is mainly considered for signals with large variation amplitude, high variation speed and poor stability like the vehicle speed. After the event type or state type signals are smoothed, the event type or state type signals are recorded and cached in a state machine, and data support is provided for subsequent event arbitration.
FIG. 5 is a flow chart of an event arbitration module shown in an exemplary embodiment of the present application.
Referring to fig. 5, determining whether the vehicle state satisfies the local rule information, and if so, that is, reaching a predetermined scene state, outputting a determination event of the rule engine to the outside includes: when the signal is changed, traversing the related rules according to the signal types to judge whether the rules are satisfied, and inquiring the event to which the rules belong if the rules are satisfied; traversing an event to be decided, and judging whether other rules exist in the event; if yes, inquiring the other rule signal values; if the other rules are successfully matched, event anti-shake judgment is carried out; and if the event anti-shake condition is met, sending the event code corresponding to the rule to the outside. Namely: the method comprises the following steps: s501, changing a vehicle-end signal, S502, traversing related rules (without rule information related to time) according to signal types, S503, judging whether the rules are met, inquiring an event to which the rules belong, S507, traversing an event to be decided, judging whether the event has other rules, S508, inquiring other rule signal values from a state machine, S509, if all other rules are successfully matched, S510, if all other rules are successfully matched, judging whether the event is anti-shake, S511, and if the event anti-shake condition is met, sending an event code corresponding to the rule to the outside.
Judging whether the vehicle state meets the local rule information or not, if so, namely, reaching a predefined scene state, outputting a judging event of the rule engine to the outside, and further comprising: timing rule ascending order, and obtaining the current system time; traversing time rules, and setting a timer according to the time difference between the system time and the time rules; after the timer is awakened, inquiring an event corresponding to the time rule; traversing an event to be decided, and judging whether other rules exist in the event; inquiring the other rule signal values; if the other rules are successfully matched, event anti-shake judgment is carried out; and if the event anti-shake condition is met, sending the event code corresponding to the rule to the outside. Namely: the method comprises the following steps: s504, timing rule ascending sorting, acquiring current system time, S505, traversing rule time, setting a timer according to the time difference between the system time and rule time, S506, inquiring an event corresponding to the time rule after the timer is awakened, S507, traversing an event to be decided, judging whether the event has other rules, S508, inquiring other rule signal values from a state machine, S509, if the other rules are successfully matched, S510, if the other rules are successfully matched, judging the event against shake, S511, and if event against shake conditions are met, sending an event code corresponding to the rule to the outside. The module completes signal judgment, event decision and event anti-shake functions. And judging signals, including judging vehicle-end event signals, state signals and time signals. The time class signal mainly designates a time class time rule, and the rule containing the time class signal is processed independently due to the specificity of the time class signal.
When the vehicle-end signal changes, the module traverses the related rule (the rule related to the time class signal is not included) according to the signal type, judges whether the rule is matched, queries an event corresponding to the rule if the rule is matched, and enters an event decision link. For the rules related to the time class signals, the module carries out ascending order on the time class rules, acquires the current system time, traverses all the time class rules, sets a timer according to the time difference between the system time and the time class rules, inquires the event corresponding to the time rule after the timer wakes up, and enters an event decision link.
For an event entering an event decision link, inquiring whether the event has other rules to be judged, if not, directly judging that the event successfully matches rule information, and entering an event anti-shake link; otherwise, inquiring whether other rules of the event are matched from a state machine, and entering an event anti-shake link if the other rules are successfully matched.
The event anti-shake link mainly judges whether an event to be triggered to the external module meets an arbitration condition, namely an anti-shake condition in rule information. Aiming at the time interval type anti-shake mechanism, the anti-shake mechanism can only be triggered once in a certain time period; aiming at the anti-shake mechanism of the frequency upper limit class, the anti-shake mechanism can be triggered only once in a single operation period of the vehicle-end rule engine. And after the event anti-shake condition is met, finally judging that the event can output an event code to the outside, namely triggering the event.
Aiming at the problem of vehicle-end resource limitation, as the state machine relates to monitoring and acquiring signals, the resource consumption is mainly concentrated in a state machine module, and the invention optimizes the resource consumption of a vehicle-end platform from the following three aspects:
in a first aspect, the state machine module optimizes: the event type signal is triggered after the external signal is changed, the related resource consumption is relatively less, and the resource optimization term is mainly concentrated on the acquisition of the state type signal. Since the state signal requires the vehicle-side rule engine to perform active polling acquisition, the state signal needs to be weighted in terms of instantaneity of signal acquisition and consumption of resources. The invention adopts a thread pool mode to acquire a state signal, and reduces resource consumption by setting an upper limit mode of the thread number; because the hardware environment of the vehicle end is complex, the thread pool can dynamically open and close the threads with the same number according to the number of blocked threads in consideration of the blocking condition in the signal acquisition process, so that the instantaneity of signal acquisition is ensured.
Second aspect, rule information base optimization: because the data size of the vehicle-end signal is large and the attention signals of different users are different, the invention supports the dynamic increase and decrease configuration of the vehicle-end monitoring signal, and reduces the performance consumption of the vehicle-end as much as possible while guaranteeing different demands of the users.
In a third aspect, event arbitration optimization: the invention provides the method for supporting the analysis and the identification of the time signals, and firstly, the method carries out special processing on the rule containing the time signals, other rules in the time signal rule cannot be independently judged, and only when the time signals are matched, the matching condition of other vehicle signals is judged, so that the number of event arbitration signals is reduced; secondly, the timer is adopted to carry out time signal judgment in a sequential dormancy and awakening mode, so that tedious processing of time signal monitoring is avoided.
Fig. 6 is a schematic diagram illustrating rule information composition according to an exemplary embodiment of the present application.
Referring to fig. 6, the rule information includes a trigger rule, an arbitration condition, and event information, the rule information includes ruleType, name, signalCode, opera, constValue, needSmooth, arbitration, arbitrationValue, eventCode fields, wherein six fields form the trigger rule, a rule type of the trigger rule indicates a trigger rule type, a name indicates a trigger rule interpretation, a signalCode indicates a signal type, an opera indicates a comparison type, a constValue indicates a comparison value, and a needledschoth indicates whether the acquired signal needs smoothing; the Arbitrate of the Arbitration condition represents an anti-shake type, and the Arbitrate value represents an anti-shake value; eventCode represents event information. It should be noted that the order of the fields representing the trigger rule, the fields representing the arbitration condition, and the fields representing the event information, which constitute the rule information, may be changed, and is not limited. The rule base is composed of a plurality of rule information, and the rule information comprises trigger rules, arbitration conditions and event information. After the triggering rule indicates that the condition is met, the rule matching is successful; the arbitration condition means rule information for judging whether or not the matching is successful to be output to the outside; the event information represents event code information which is sent to the outside after rule matching is successful and arbitration passes.
The rule information contains fields of rule type, name, signalCode, opera, constValue, needledschoth, arbition and ArbitrationValue, eventCode. Wherein the first 6 fields form a trigger rule, and the rule information support contains a plurality of trigger rules, and the rule is successfully matched only when all the trigger rules are met. Rule type indicates a trigger rule type, including event (event class signal), status (status class signal), time (time class signal). The event type signal is that after the state of the signal is changed, a notification type message is actively sent, and if the state is not changed, no notification information is sent. The state signal refers to that no matter whether the state of the signal changes, the signal can not actively send a notification message, and the notification message needs to be actively acquired in a service calling mode. The time class signal refers to the current system time, and supports two time types, namely a timing trigger class (e.g. 12:00 triggers per day), and a cyclic trigger class (e.g. triggers once every 10 min). Name indicates a trigger rule interpretation, such as "vehicle speed greater than 100km/h". SignalCode represents a signal type that identifies what services the rules engine should monitor or invoke. Opera represents comparison type, such as greater than, less than, etc.; constValue represents a comparison value; the opera and the constValue are used for judging whether the vehicle-end signal meets the triggering rule. Needlesmooth indicates whether or not the acquired vehicle-end signal needs smoothing processing, for example, as for a vehicle speed signal, since the vehicle speed may change rapidly, it is necessary to perform smoothing processing on the vehicle speed signal, and a value after smoothing processing is used as an input for judging a trigger rule.
The Arbition and ArbitionValue constitute an Arbitration condition, which is in one-to-one correspondence with rule information. Arbitration represents an anti-shake type, and support time intervals and upper limit of times, arbitrationValue represents an anti-shake value. If the Arbition represents a time interval, the ArbitionValue represents that the rule can be triggered only once in the corresponding time class; if the Arbitration indicates an upper limit of the number of times, then ArbitrationValue indicates an upper trigger limit within the run period of the rule engine.
EventCode represents event information, which is represented in the form of event codes, and is used as output information of a rule engine, and when a certain rule is matched, the rule engine can inform an external module of the event codes of the rule.
The embodiment of the application also provides a device for realizing the rule engine at the vehicle end, which comprises: the rule distribution module is used for synchronizing rule information of cloud configuration and updating local rule information based on the rule information of the cloud configuration;
the state machine module is used for monitoring and acquiring the vehicle state in real time based on the SOA architecture; and the event arbitration module is used for judging whether the vehicle state meets the local rule information or not, and if so, the event arbitration module reaches a predefined scene state and outputs the judging event of the rule engine to the outside.
It should be noted that, the device for implementing the vehicle-end rule engine provided in the foregoing embodiment and the method for implementing the vehicle-end rule engine provided in the foregoing embodiment belong to the same concept, and the specific manner in which each module and unit perform the operation has been described in detail in the method embodiment, which is not described herein again. In practical applications, the image processing apparatus provided in the foregoing embodiments may allocate the functions to different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above, which is not limited herein.
The embodiment of the application also provides electronic equipment, which comprises: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic equipment realizes the vehicle-end rule engine implementation method provided in each embodiment.
The computer system of the electronic device includes a central processing unit that can perform various appropriate actions and processes according to a program stored in a read only memory or a program loaded from a storage section into a random access memory, for example, performing the methods described in the above embodiments. In the RAM, various programs and data required for the system operation are also stored. The CPU, ROM and RAM are connected to each other by a bus. An input/output interface is also connected to the bus. The following components are connected to the I/O interface: an input section including a keyboard, a mouse, etc.; an output section including a cathode ray tube, a liquid crystal display, etc., a speaker, etc.; a storage section including a hard disk or the like; and a communication section including a network interface card such as a LAN card, a modem, and the like. The communication section performs communication processing via a network such as the internet. The drives are also connected to the I/O interfaces as needed. Removable media such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, and the like are mounted on the drive as needed so that a computer program read therefrom is mounted into the storage section as needed.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method shown in the flowchart. In such embodiments, the computer program may be downloaded and installed from a network via a communication portion, and/or installed from a removable medium. The computer program, when executed by the central processing unit, performs the various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, a flash memory, an optical fiber, a portable compact disc read-only memory, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with a computer-readable computer program embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Where each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
Another aspect of the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a vehicle end rules engine implementation method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment or may exist alone without being incorporated in the electronic device.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, in accordance with embodiments of the present application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Another aspect of the present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the vehicle-end rule engine implementation method provided in the above embodiments.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a usb disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the method according to the embodiments of the present application.
It should be understood that the foregoing is only a preferred exemplary embodiment of the present application and is not intended to limit the embodiments of the present application, and that corresponding changes and modifications may be made by one of ordinary skill in the art in light of the general concepts and spirit of the present application, and the scope of the present application is therefore limited by the scope of the appended claims.

Claims (12)

1. The method for realizing the rule engine at the vehicle end is characterized by comprising the following steps:
synchronizing rule information of cloud configuration, and updating local rule information based on the rule information of the cloud configuration;
Monitoring and acquiring the vehicle state in real time based on the SOA architecture;
judging whether the vehicle state meets the local rule information or not;
if the condition is satisfied, that is, a predefined scene state is reached, a determination event of the rule engine is output to the outside.
2. The method for implementing the vehicle-side rule engine according to claim 1, wherein synchronizing rule information of a cloud configuration and updating local rule information based on the rule information of the cloud configuration comprises:
acquiring rule information of the cloud configuration;
updating the local rule information based on the rule information configured by the cloud;
analyzing the updated rule information into a memory;
registering or deregistering the monitored event signals and registering or deregistering the service state calling signals according to the signal types of different triggering conditions of the rule information after updating.
3. The method for implementing the vehicle-side rule engine according to claim 2, wherein monitoring and acquiring the vehicle state in real time based on the SOA architecture comprises:
monitoring event class signals or polling state class signals;
judging whether the event type signal or the state type signal needs smoothing processing, and if so, adopting a mode of calculating an average value/a moving average value/multi-point sampling to process;
And recording the event type signal or the state type signal after the buffer smoothing processing.
4. The method for implementing the rules engine at the vehicle end according to claim 3, wherein monitoring event class signals comprises: and when the event type signal changes, recording a signal value through a registered callback function.
5. A method of implementing a vehicle-end rules engine as claimed in claim 3, wherein polling the status class signal comprises: polling the state type signal by using a thread pool, wherein the thread pool has an upper limit of thread quantity; and the thread pool records the thread information of the blocking signals, opens up a corresponding number of new threads to acquire the state type signals until the blocking threads are released, and destroys the new threads.
6. The vehicle-side rule engine implementation method according to claim 3, wherein determining whether the vehicle state satisfies the local rule information, and if so, that a predefined scene state is reached, outputting a determination event of the rule engine to the outside, includes:
when the signal is changed, traversing the related rules according to the signal types to judge whether the rules are satisfied, and inquiring the event to which the rules belong if the rules are satisfied;
Traversing an event to be decided, and judging whether other rules exist in the event;
if yes, inquiring the other rule signal values;
if the other rules are successfully matched, event anti-shake judgment is carried out;
and if the event anti-shake condition is met, sending the event code corresponding to the rule to the outside.
7. The vehicle-side rule engine implementation method according to claim 3, wherein determining whether the vehicle state satisfies the local rule information, and if so, that a predefined scene state is reached, outputting a determination event of the rule engine to the outside, further comprises:
timing rule ascending order, and obtaining the current system time;
traversing time rules, and setting a timer according to the time difference between the system time and the time rules;
after the timer is awakened, inquiring an event corresponding to the time rule;
traversing an event to be decided, and judging whether other rules exist in the event;
inquiring the other rule signal values;
if the other rules are successfully matched, event anti-shake judgment is carried out;
and if the event anti-shake condition is met, sending the event code corresponding to the rule to the outside.
8. The method according to claim 7, wherein the rule information includes a trigger rule, an arbitration condition, and event information, the rule information includes a ruleType, name, signalCode, opera, constValue, needSmooth, arbitration, arbitrationValue, eventCode field, six fields form the trigger rule, a rule type of the trigger rule indicates a trigger rule type, a name indicates a trigger rule interpretation, a signalCode indicates a signal type, an operator indicates a comparison type, a constval indicates a comparison value, and a needledspinth indicates whether the acquired signal needs smoothing; the Arbitrate of the Arbitration condition represents an anti-shake type, and the Arbitrate value represents an anti-shake value; eventCode represents event information.
9. A vehicle-end rule engine implementation apparatus, comprising:
the rule distribution module is used for synchronizing rule information of cloud configuration and updating local rule information based on the rule information of the cloud configuration;
the state machine module is used for monitoring and acquiring the vehicle state in real time based on the SOA architecture;
and the event arbitration module is used for judging whether the vehicle state meets the local rule information or not, and if so, the event arbitration module reaches a predefined scene state and outputs the judging event of the rule engine to the outside.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs that, when executed by one or more processors, cause the electronic device to implement the vehicle end rules engine implementation method of any of claims 1 to 9.
11. A computer readable storage medium having stored thereon computer readable instructions which, when executed by a processor of a computer, cause the computer to perform the vehicle end rules engine implementation method of any of claims 1 to 8.
12. A computer program product comprising a computer program which, when executed by a processor, implements the vehicle end rules engine implementation method of any one of claims 1 to 8.
CN202211524428.7A 2022-11-30 2022-11-30 Method and device for realizing vehicle-end rule engine, electronic equipment and storage medium Pending CN116149761A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211524428.7A CN116149761A (en) 2022-11-30 2022-11-30 Method and device for realizing vehicle-end rule engine, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211524428.7A CN116149761A (en) 2022-11-30 2022-11-30 Method and device for realizing vehicle-end rule engine, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116149761A true CN116149761A (en) 2023-05-23

Family

ID=86337958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211524428.7A Pending CN116149761A (en) 2022-11-30 2022-11-30 Method and device for realizing vehicle-end rule engine, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116149761A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116578786A (en) * 2023-07-14 2023-08-11 深圳联友科技有限公司 Intelligent refueling recommendation method and device based on vehicle data analysis

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116578786A (en) * 2023-07-14 2023-08-11 深圳联友科技有限公司 Intelligent refueling recommendation method and device based on vehicle data analysis

Similar Documents

Publication Publication Date Title
CN109889551B (en) Method for accessing intelligent hardware to Internet of things cloud platform
US8375136B2 (en) Defining and implementing policies on managed object-enabled mobile devices
US10630752B2 (en) Identity service management in limited connectivity environments
US20090049518A1 (en) Managing and Enforcing Policies on Mobile Devices
CN109582310B (en) Data processing method and device, electronic equipment and computer readable storage medium
US11632373B2 (en) Activity based authorization for accessing and operating enterprise infrastructure
WO2009021200A1 (en) Managing and enforcing policies on mobile devices
EP2665020A2 (en) Incremental reasoning under data source availability constraints
CN108351760B (en) Feed service engine
EP3809697A1 (en) Method and system for defining camera by using software, and camera
CN110471738B (en) Theme switching method and device of application program, electronic equipment and storage medium
CN110351366A (en) A kind of service scheduling method of Internet application, system and computer readable storage medium
CN111953648A (en) Data processing method and device based on block chain prediction machine and electronic equipment
WO2021139383A1 (en) Live broadcast room gift resource updating method and apparatus, and medium and electronic device
CN113709810B (en) Method, equipment and medium for configuring network service quality
CN116149761A (en) Method and device for realizing vehicle-end rule engine, electronic equipment and storage medium
CN114168297A (en) Method, device, equipment and medium for scheduling collection tasks
CN114979144B (en) Cloud edge communication method and device and electronic equipment
CN112818139A (en) Edge calculation data management method, device and equipment applied to security monitoring
CN113608778A (en) Application management method and device, storage medium and electronic equipment
CN112565173B (en) Method and apparatus for message processing
KR20190077926A (en) Iot device monitoring framework, fog server equipped with the same and fog computing system
CN112632542B (en) Application program detection file dynamic adjustment method and device, electronic equipment and medium
US20230014025A1 (en) Method and device for processing service using request, and computer readable storage medium
CN113779374A (en) Page query management method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination