Signal association method, apparatus, device, medium and program product
Patent Information
- Application Number
- CN202510468011.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2026-10-20
AI Technical Summary
[0003]然而,RTE的上述信号管理和传输的方式虽然简单直接,但由于完全依赖于RTE,从而使其信号关联的灵活性不足
[0040]本申请实施例提供的信号关联方法,确定待第一服务组件访问的第一信号后,通过与全局信号池关联的第一传输接口,从全局信号池中获取第一信号,而第一信号包括第二服务组件所管理的信号,且全局信号池中存储有车辆的服务组件所管理的信号的集合,如此,在第一服务组件与第二服务组件为车辆中的任意两个不同的服务组件的情况下,借助于全局信号池,使得车辆中任意服务组件需要访问的信号均能够灵活高效地获取,从而提高了车辆中不同服务组件之间信号共享的效率和灵活性;并且,将第一信号关联至第一服务组件,以供第一服务组件基于第一信号执行数据处理操作,降低了车辆中第一服务组件关联第二服务组件所管理的第一信号的复杂度;与此同时,由于第一信号为第二服务组件所管理的信号,且第一传输接口与全局信号池关联,如此,降低了车辆中服务组件之间的信号关联对RTE的依赖程度,提高了将车辆中第二服务组件所管理的信号关联至第一服务组件的灵活性。
Smart Images

Figure HDA0005359321300000011 
Figure HDA0005359321300000021 
Figure HDA0005359321300000031
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle signal processing technology, and in particular to a signal association method, apparatus, device, medium, and program product. Background Technology
[0002] In the Automotive Open System Architecture (AUTOSAR) widely used in vehicles, most manufacturers use the Runtime Environment (RTE) as an intermediate layer for communication between application software components and basic software to achieve signal management and correlation between software components (SWC).
[0003] However, while the signal management and transmission methods described above for RTE are simple and direct, their complete reliance on RTE results in insufficient flexibility in signal correlation. Summary of the Invention
[0004] Based on the above technical problems, embodiments of this application provide a signal association method, apparatus, device, medium, and program product, which can realize flexible association between signals managed by different service components of a vehicle through a reusable first transmission interface.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides a signal correlation method, the method comprising:
[0007] Determine a first signal to be accessed by the first service component; wherein the first signal includes signals managed by the second service component;
[0008] The first signal is obtained from the global signal pool through a first transmission interface associated with the global signal pool; wherein the global signal pool stores a set of signals managed by the vehicle's service components;
[0009] The first signal is associated with the first service component so that the first service component can perform data processing operations based on the first signal.
[0010] In some embodiments, associating the first signal with the first service component includes:
[0011] If the first signal is a single signal, the first signal is written to the first cache space of the first application through the second transmission interface; wherein, the first service component is used to implement at least some of the functions of the first application;
[0012] The first signal is read from the first cache space to associate the first signal with the first service component.
[0013] In some embodiments, after writing the first signal to the first cache space of the first application through the second transmission interface, the method further includes:
[0014] Set the read / write status of the first cache space to the written state;
[0015] After reading the first signal from the first buffer space, the method further includes:
[0016] Set the read / write status of the first cache space to "read".
[0017] In some embodiments, obtaining the first signal from the global signal pool includes:
[0018] If the first signal is a single signal in the first signal set managed by the second service component, obtain the first application identifier of the second application; wherein, the second service component is used to implement at least some of the functions of the second application;
[0019] The first signal is obtained from the global signal pool based on the first application identifier, the first set identifier of the first signal set, and the first signal identifier of the first signal.
[0020] In some embodiments, obtaining the first signal from the global signal pool includes:
[0021] If the first signal is any of the signals in the first signal set managed by the second service component, obtain the first application identifier of the second application associated with the second service component;
[0022] Based on the first application identifier and the first set identifier of the first signal set, all signals in the first signal set are obtained from the global signal pool.
[0023] In some embodiments, the method further includes:
[0024] Determine the second signal to be written to the global signal pool by the third service component;
[0025] If the second signal is a single signal in the second signal set managed by the third service component, the second signal is written into the second cache space of the third application based on the second set identifier of the second signal set; wherein, the third service component is used to implement at least some of the functions of the third application;
[0026] The second signal stored in the second cache space is written into the global signal pool through the third transmission interface associated with the global signal pool, based on the second application identifier and the second set identifier of the third application.
[0027] In some embodiments, after writing the second signal into the second cache space of the third application, the method further includes:
[0028] Set the read / write status of the second cache space to the written state;
[0029] After writing the second signal stored in the second buffer space into the global signal pool, the method further includes:
[0030] Set the read / write status of the second cache space to "read".
[0031] In some embodiments, the method further includes:
[0032] If the second signal is any of the signals in the second signal set managed by the third service component, then all the signals in the second signal set are written into the global signal pool based on the second application identifier.
[0033] This application embodiment also provides a signal association device, the signal association device comprising:
[0034] The determining module is used to determine a first signal to be accessed by the first service component; wherein the first signal includes signals managed by the second service component;
[0035] A transmission module is configured to acquire the first signal from the global signal pool via a first transmission interface associated with the global signal pool; wherein the global signal pool stores a set of signals managed by the vehicle's service components;
[0036] The association module is used to associate the first signal with the first service component, so that the first service component can perform data processing operations based on the first signal.
[0037] This application also provides an electronic device, which includes a processor and a memory; the memory stores a computer program; when the computer program is executed by the processor, it can implement the signal association method as described above.
[0038] This application also provides a computer-readable storage medium storing a computer program; when the computer program is executed by a processor of an electronic device, it can implement the signal association method as described above.
[0039] This application also provides a computer program product, which includes a computer program; when the computer program is executed by a processor of an electronic device, it can implement the signal association method as described above.
[0040] The signal association method provided in this application, after determining the first signal to be accessed by the first service component, obtains the first signal from the global signal pool through a first transmission interface associated with the global signal pool. The first signal includes signals managed by the second service component, and the global signal pool stores a set of signals managed by the service components of the vehicle. Thus, even if the first service component and the second service component are any two different service components in the vehicle, the global signal pool enables any service component in the vehicle to obtain the signals it needs to access flexibly and efficiently, thereby improving the efficiency and flexibility of signal sharing between different service components in the vehicle. Furthermore, associating the first signal with the first service component allows the first service component to perform data processing operations based on the first signal, reducing the complexity of associating the first signal managed by the second service component with the first signal managed by the second service component. At the same time, since the first signal is managed by the second service component and the first transmission interface is associated with the global signal pool, the dependence of signal association between service components in the vehicle on RTE is reduced, and the flexibility of associating signals managed by the second service component in the vehicle with the first service component is improved. Attached Figure Description
[0041] Figure 1 A flowchart illustrating the signal correlation method provided in an embodiment of this application;
[0042] Figure 2 This is a schematic diagram of the structure for setting up a global signal pool in AUTOSAR, provided in an embodiment of this application.
[0043] Figure 3 This is a schematic diagram of the application and signal storage structure in the global signal pool provided in the embodiments of this application;
[0044] Figure 4 This is a schematic diagram of the signal association structure provided in an embodiment of this application;
[0045] Figure 5 This is a schematic diagram of the structure of the signal correlation device provided in the embodiments of this application;
[0046] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0048] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0049] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0050] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0051] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.
[0052] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0053] 1) AUTOSAR: This architecture defines the software architecture for the vehicle's controller. This software architecture separates the vehicle's hardware and software, bringing together independent functional model software and software components developed by different manufacturers, and then combining them into a specific project through an automatic configuration process.
[0054] 2) RTE: It is a key module in the AUTOSAR architecture. It provides an intermediate layer for application software components to manage data exchange, signal exchange and service calls between software components, thereby improving the portability and modularity of the system.
[0055] 3) SOA: is a component model that connects different functional units of an application (called services) through interfaces and contracts. The interfaces are defined in a neutral manner, independent of the hardware platform, operating system, and programming language used to implement the services.
[0056] With the diversification and increasing complexity of vehicle functions, as well as the growing demand for efficient business logic development, the application trend of software-defined vehicles (SDVs) is becoming increasingly apparent. SOA provides a good solution for SAVs. It abstracts the functional modules of a software system into a series of independent, reusable services. These services communicate and collaborate through well-defined interfaces and protocols, enabling a high degree of modularity in automotive software systems, improving their scalability and maintainability, and thus enhancing the efficiency and quality of automotive software development.
[0057] Meanwhile, in SOA-based AUTOSAR vehicle control software, there are scenarios where multiple signals need to be read or processed simultaneously between SOA service components and SWC, as well as between different service components. In related technologies, these related signals are typically bound into a signal group for synchronous transmission via RTE in AUTOSAR to ensure consistency and correlation between signals. This not only improves the temporal synchronization of signals within the signal group but also significantly enhances communication efficiency and data integrity. Therefore, the signal synchronization mechanism described above, which uses signal groups for signal transmission, can meet the real-time and scalability requirements of complex vehicle control systems.
[0058] However, although the method of reading and writing the signal group as a whole adopted by RTE is simple and direct, it results in low flexibility of the above signal transmission method because it relies on RTE.
[0059] Based on the above problems, embodiments of this application provide a signal correlation method, apparatus, device, medium, and program product.
[0060] Figure 1 This is a flowchart illustrating the signal correlation method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method may include the following steps:
[0061] S101. Determine the first signal to be accessed by the first service component.
[0062] The first signal includes signals managed by the second service component.
[0063] In one implementation, the number of signals in the first signal can be at least one; for example, when the number of signals in the first signal is one, the first signal can be a single signal, and when the number of signals in the first signal is multiple, the first signal can be an array signal or a structure signal.
[0064] In one implementation, the first signal may be at least a portion of the signals managed by the second service component.
[0065] In one implementation, the first signal can be a signal managed by SOA or a signal managed by AUTOSAR.
[0066] In one implementation, the first signal may be a signal that the first service component depends on to perform its function.
[0067] In one implementation, the first service component may include software components or application software (ASW) in AUTOSAR, and may also include service components in SOA.
[0068] For example, AUTOSAR and SOA can be installed in the vehicle at the same time, and the first service component can include a service component associated with AUTOSAR or SOA; and the first service component can implement at least some of the functions of the first application installed in the vehicle. Thus, in the process of the first application starting the first service component to attempt to implement the above-mentioned at least some functions, the first service component can be triggered to determine the first signal required for it to implement the above-mentioned at least some functions.
[0069] S102. Obtain the first signal from the global signal pool through the first transmission interface associated with the global signal pool.
[0070] The global signal pool stores a collection of signals managed by the vehicle's service components.
[0071] Figure 2 This is a schematic diagram illustrating the structure of setting up a global signal pool in AUTOSAR, as provided in an embodiment of this application. Figure 2 As shown, AUTOSAR, from top to bottom, can include an application layer, a real-time operating environment, a basic software layer, and hardware. The application layer can contain N applications, including APP-1, APP-2, and APP-N. The real-time operating environment can include an RTE and a Global Signal Pool (GSP) to provide signal interaction for the various service components installed in the vehicle. The basic software layer and hardware are consistent with the structure of AUTOSAR in related technologies. N can be an integer greater than or equal to 3.
[0072] In one implementation, the service component may include software components in all architectures installed in the vehicle used to implement data processing functions; exemplarily, the architecture may include AUTOSAR and SOA; then, correspondingly, the global signal pool may be used to store signals managed by the SOA service component, and may also be used to store signals interacting between the AUTOSAR service component and the SOA service component, and may also store signals managed by the AUTOSAR service component or software component; exemplarily, for AUTOSAR compatibility, such as Figure 2 As shown, a storage area can be pre-allocated in the vehicle's AUTOSAR architecture, specifically for storing the global signal pool.
[0073] In one implementation, any service component associated with AUTOSAR and SOA can read signals from the global signal pool through a first transmission interface. For example, the first transmission interface may include an application programming interface (API) associated with the global signal pool, and this API can implement the operation of reading signals from the global signal pool. For example, the first transmission interface can be embodied in the following ways:
[0074] uint8 GSP_API_Read(SignalIdType sigId,void*pSigVar,size_t siglen)
[0075] Wherein, sigId is the signal identifier or macro identifier stored in the global signal pool, psigVar is a pointer to the variable used to store the signal, and siglen is the length of the variable used to store the signal. If the return value of this interface is 0, it indicates that the signal was read successfully; if the return value of this interface is non-zero, it indicates that the signal was read unsuccessfully. For example, the macro identifier may include the macro name of the signal corresponding to the signal identifier.
[0076] It should be noted that during the signal reading process, the input parameters of the above interface can be checked. For example, if the macro identifier indicated by sigId does not match the macro identifier of the first signal, or if sigLen does not match the length of the first signal, a reading error can be indicated.
[0077] For example, the first signal can be pre-written into the global signal pool by the second service component. In this case, the first service component can determine the first storage address of the first signal in the global signal pool based on the signal identifier of the first signal, and obtain the first signal from the global signal pool based on the first storage address through the first transmission interface. Alternatively, if the first signal is not stored in the global signal pool, the message that the first service component needs to access the first signal can be synchronized to the second service component to trigger the second service component to write the first signal into the global signal pool in response to the message, thereby enabling the first service component to obtain the first signal from the global signal pool through the first transmission interface.
[0078] S103. Associate the first signal with the first service component so that the first service component can perform data processing operations based on the first signal.
[0079] In one implementation, associating the first signal with the first service component can be achieved in any of the following ways:
[0080] The first signal is sent to the first service component to associate the first signal with the first service component.
[0081] The first signal is stored at an address that the first service component can directly access, and the address is sent to the first service component so that the first service component can obtain the first signal from the address when it needs to process or access the first signal.
[0082] In one implementation, the first service component performs data processing operations based on the first signal, which can be achieved in any of the following ways:
[0083] The first service component edits or updates the signal value of the first signal.
[0084] The first service component performs at least one data processing operation based on the signal value and signal type of the first signal.
[0085] As can be seen from the above, the signal association method provided in this application, after determining the first signal to be accessed by the first service component, obtains the first signal from the global signal pool through the first transmission interface associated with the global signal pool. The first signal includes signals managed by the second service component, and the global signal pool stores a set of signals managed by the service components of the vehicle. Thus, when the first service component and the second service component are any two different service components in the vehicle, the global signal pool enables any service component in the vehicle to obtain the signals it needs to access flexibly and efficiently, thereby improving the efficiency and flexibility of signal sharing between different service components in the vehicle. Furthermore, associating the first signal with the first service component allows the first service component to perform data processing operations based on the first signal, reducing the complexity of associating the first signal managed by the second service component with the first signal managed by the second service component. At the same time, since the first signal is a signal managed by the second service component, and the first transmission interface is associated with the global signal pool, the dependence of signal association between service components in the vehicle on RTE is reduced, and the flexibility of associating signals managed by the second service component in the vehicle with the first service component is improved.
[0086] Based on the foregoing embodiments, the signal association method provided in this application, which associates a first signal with a first service component, can be implemented through the following steps:
[0087] SA-1. If the first signal is a single signal, the first signal is written to the first cache space of the first application through the second transmission interface.
[0088] The first service component is used to implement at least some of the functions of the first application.
[0089] Accordingly, if the first signal is not a single signal, then the first signal does not need to be written into the first buffer space.
[0090] In one implementation, the first application may include a service component associated with AUTOSAR, and may also include a service component associated with SOA, wherein the service component associated with AUTOSAR in the first application may be as follows: Figure 2 The SWC (ASW) is set in APP-1 to APP-N respectively, and the service components associated with SOA in the first application may include, for example... Figure 2 SOA Services are configured in APP-1 to APP-N respectively.
[0091] In one implementation, a cache space can be set up in the storage space of the vehicle's SOA and / or AUTOSAR associated applications. Figure 3 This is a schematic diagram of the application and signal storage structure in the global signal pool provided in the embodiments of this application, such as... Figure 3 As shown, APP-1 301 and APP-2 302 each have a Cache in their storage space, which is used to cache single signals read from the global signal pool and can also be used to cache single signals to be written to the global signal pool; GSP 303 can store signals or signal groups written by each application.
[0092] It should be noted that in GSP, signal groups can be classified according to their application or service component origin, and signal groups of the same category can be placed in the same data segment. Memory Protection Unit (MPU) permissions can be set for signal groups of the same category, so that signal groups can only be written to by their respective application or service component, while other applications or service components can only perform read operations.
[0093] For example, the first cache space can be Figure 3 The cache shown is used to store single signals read from the global semaphore pool by the first application, as well as single signals to be written to the global semaphore pool.
[0094] In one implementation, the second transmission interface may include a Cache API interface for writing single signals to an application in the vehicle.
[0095] For example, the address of the storage unit in the first buffer space that can be used to write signals can be determined in advance, and the first signal can be written into the first buffer space through the second transmission interface based on the address.
[0096] SA-2: Read the first signal from the first cache space to associate the first signal with the first service component.
[0097] In one implementation, the first signal in the first cache space can be read and written to the storage space that the first service component can manage, thereby realizing the mutual association between the first signal and the first service component.
[0098] As can be seen from the above, the signal association method provided in this application embodiment, if the first signal is a single signal, then the first signal is written into the first cache space of the first application through the second transmission interface, and the first signal is read from the first cache space to associate the first signal with the first service component. In this way, through the first cache space, not only is the first signal cached, but also the mutual isolation between the first service component and the global signal pool is achieved.
[0099] Based on the foregoing embodiments, in the signal association method provided in this application embodiment, after writing the first signal to the first cache space of the first application through the second transmission interface, the following operations can also be performed:
[0100] Set the read / write status of the first cache space to "written".
[0101] Accordingly, after reading the first signal from the first buffer space, the following operations can also be performed:
[0102] Set the read / write status of the first cache space to "read".
[0103] In one implementation, the read / write status can be used to indicate whether a signal stored in the first cache space or a storage unit of the first cache space has been read or written.
[0104] In one implementation, the read / write state is used to characterize whether write operations to the first cache space or its storage units are prohibited. For example, if a first signal is written to the first storage unit in the first cache space, the read / write state of the first storage unit can be set to the written state. At this time, read operations can be performed on the first storage unit in the first cache space, but write operations are prohibited. For example, if both the first and second storage units in the first cache space are written with signals, the read / write states of both the first and second storage units can be set to the written state. At this time, only read operations can be performed on the first and second storage units, but write operations cannot be performed. Furthermore, when the first signal stored in the first storage unit, or all the signals stored in the first and second storage units, are read completely, their respective read / write states can be set to the read state. At this time, the first storage unit, or the first and second storage units, are released to a state where they can be rewritten with signals.
[0105] As can be seen from the above, the signal association method provided in this application, after writing the first signal to the first cache space, sets the read / write state of the first cache space to the written state, and after reading the first signal from the first cache space, sets the read / write state of the first cache space to the read state. Thus, through the above method, write protection of the first signal stored in the first cache space can be achieved, thereby improving the signal integrity of the first signal during the process of associating it with the first service component, as well as the security of data read / write operations of the first signal in the first cache space.
[0106] In practical architectures that manage signals via RTE, even if only a single signal needs to be modified or accessed, the entire signal group still needs to be transmitted and processed, which leads to unnecessary performance consumption. Furthermore, with limited data processing resources, the above processing operations can easily cause additional latency for applications that require fast response or high real-time performance, which is not conducive to achieving high-precision operation control. At the same time, comprehensive maintenance of the signal processing logic of the signal group will also increase the complexity of system maintenance.
[0107] Based on the above technical problems, this application provides a method for obtaining a single signal from a global signal pool, as shown below:
[0108] If the first signal is a single signal in the first signal set managed by the second service component, obtain the first application identifier of the second application; based on the first application identifier, the first set identifier of the first signal set, and the first signal identifier of the first signal, obtain the first signal from the global signal pool.
[0109] The second service component is used to implement at least some of the functions of the second application.
[0110] Accordingly, if the first signal is not a single signal in the first signal set managed by the second service component, the first application identifier of the second application can still be obtained, or the first application identifier can be left unobtained.
[0111] In one implementation, the first application identifier may include the number and / or name of the second application.
[0112] In one implementation, the second application may include a second service component; for example, the second service component may include a service component or application component managed by AUTOSAR, and may also include a service component or software component managed by SOA.
[0113] In one implementation, the first set identifier may include a number and / or name of the first signal set; exemplarily, the name may include a macro name; exemplarily, the first signal set may be as follows: Figure 3 The SG1, SG2, and SG3 shown can be, for example, SG1 can be a first signal set managed by a first service component, and S11, S12, and S13 included in SG1 can be single signals in SG1; SG2 can be a second signal set managed by a second service component, and S21 and S22 included in SG2 can be single signals in SG2; SG3 can be a third signal set managed by a third service component, and S31, S32, and S33 included in SG3 can be single signals included in SG3; and, from Figure 3As can be seen, whether in the Cache or the GSP, individual signals in different signal sets can be stored continuously.
[0114] For example, in the SOA or AUTOSAR of a vehicle, a first association relationship can be pre-established between the component identifier of a service component, the application identifier of the application associated with the service component, and the signal identifier of the signal managed by the service component. In this way, when it is determined that the first signal needs to be obtained, the first application identifier of the second application can be determined based on the first signal identifier of the first signal and the first association relationship.
[0115] For example, in a global semaphore pool, signals managed by the same service component and the same application can be stored continuously as signal sets. Simultaneously, the same application may include multiple service components, allowing the same application to be associated with multiple signal sets. To improve the efficiency of addressing signals in the global semaphore pool, a second association relationship can be pre-established between the storage addresses of multiple signal sets managed by the application in the global semaphore pool and the application identifier of the application. Furthermore, when signals in multiple signal sets are stored in the global semaphore pool, they can all carry signal identifier data. In this case, after determining the first application identifier, the first set identifier, and the first signal identifier, the storage address of the first signal set in the global semaphore pool can be determined first based on the second association relationship and the first application identifier and the first set identifier. Then, the signal identifier stored at the aforementioned storage address is matched with the first signal identifier to determine the storage address of the first signal. The storage address of the first signal is then used as the input parameter of the first transmission interface, thus obtaining the first signal from the global semaphore pool through the first transmission interface set.
[0116] As can be seen from the above, the signal association method provided in this application embodiment, if the first signal is a single signal in the first signal set managed by the second service component, obtains the first application identifier of the second application, and obtains the first signal from the global signal pool based on the first application identifier, the first set identifier of the first signal set, and the first signal identifier of the first signal. The second service component is used to implement at least some of the functions of the second application. Thus, through the above steps, a targeted search for the first signal in the global signal pool is achieved, thereby improving the accuracy and stability of the first signal search.
[0117] It's important to note that manipulating a single signal typically involves fewer code logic and processing steps, and allows for faster and more accurate access to or modification of that specific signal. Therefore, for applications in vehicles, acquiring a single signal is logically simpler and more intuitive compared to acquiring a group of signals. Furthermore, single-signal operations reduce dependence on signal groups, thereby simplifying code structure and making debugging, testing, and maintenance easier. This optimization of the single-signal access process is particularly suitable for scenarios requiring frequent access to or updates of specific single signals, while also improving the flexibility and scalability of signal handling during application development.
[0118] Based on the foregoing embodiments, the signal association method provided in this application, which obtains the first signal from the global signal pool, can also be implemented in the following ways:
[0119] If the first signal is any of the signals in the first signal set managed by the second service component, obtain the first application identifier of the second application associated with the second service component; based on the first application identifier and the first set identifier of the first signal set, obtain all the signals in the first signal set from the global signal pool.
[0120] Accordingly, if the first signal is a single signal in the first signal set, the single signal corresponding to the first signal can be obtained from the global signal pool by the method provided in the foregoing embodiments.
[0121] In one implementation, the first signal set may be a signal group managed by the second service component.
[0122] For example, a third association relationship can be pre-established between the component identifier of the service component in AUTOSAR and SOA, the storage address of the signal set managed by the service component in the global signal pool, and the application identifier of the application to which the service component belongs. The storage address of the signal set in the global signal pool can be represented by the set identifier of the signal set. Thus, after determining the first set identifier and the first application identifier, the storage address of the first signal set in the global signal pool can be determined based on the first set identifier, the first application identifier, and the third association relationship. This storage address is then set as the input parameter of the first transmission interface, and the first signal set is obtained from the global signal pool by calling the first transmission interface.
[0123] For example, signals that need to be transmitted synchronously and belong to the same service component can be bound to a structure to form a signal group, i.e., the first signal set, and then the first signal set can be written into the global signal pool.
[0124] As can be seen from the above, the signal association method provided in this application embodiment, if the first signal is all the signals in the first signal set managed by the second service component, then obtains the first application identifier of the second application associated with the second service component, and obtains the first signal set from the global signal pool based on the first application identifier and the first set identifier of the first signal set. Thus, through the above operations, when the first signal set is a signal group, it achieves flexible and efficient acquisition of the signal group from the global signal pool, thereby enabling flexible and efficient sharing and association of signal groups between different service components without relying on RTE; furthermore, compared to reading and writing single signals, using signal groups can reduce the complexity of synchronization logic between different signals and reduce the probability of signal read / write errors.
[0125] Based on the foregoing embodiments, the signal association method provided in this application can also perform the following steps:
[0126] SC-1: Determine the second signal to be written to the global signal pool by the third service component.
[0127] In one implementation, the third service component can be a service component or software component in AUTOSAR or SOA.
[0128] For example, after generating or updating the second signal, the third service component can write the second signal to the global signal pool to provide data support for the sharing and association of the second signal among different service components.
[0129] SC-2. If the second signal is a single signal in the second signal set managed by the third service component, the second signal is written into the second cache space of the third application based on the second set identifier of the second signal set.
[0130] The third service component is used to implement at least some of the functions of the third application.
[0131] Accordingly, if the second signal is not a single signal in the second signal set, then the second signal does not need to be written into the second buffer space.
[0132] In one implementation, the second cache space may include a cache in a third application.
[0133] For example, to improve the efficiency of signal writing and addressing in the cache space, signals written by the same service component can be stored together consecutively in the cache space of each application. Furthermore, a fourth association relationship can be pre-established between the set identifier of the signal set corresponding to the service component and the storage address of the signal set. Thus, after determining the second identifier set, the entry point of the storage unit in the second cache space used to store the second signal set can be determined based on the second identifier set and the fourth association relationship, and the second signal can be written to that storage unit.
[0134] SC-3: Through the third transmission interface associated with the global signal pool, based on the second application identifier and the second set identifier of the third application, the second signal stored in the second buffer space is written into the global signal pool.
[0135] For example, the storage address of the second signal set in the global signal pool can be determined by the method in the foregoing embodiments, and the address of the storage unit in the storage unit pointed to by the storage address that can write the signal is used as the write address of the second signal. Then, the write address of the second signal is used as the input parameter of the third transmission interface, and the third transmission interface is called to write the second signal into the global signal pool.
[0136] In one implementation, the third transmission interface can be a standard API write interface for writing signals to the global signal pool; for example, the third transmission interface can be as follows:
[0137] uint8 GSP_API_Write(SignalIdType sigId,const void*pSigVar,size_tsigle n)
[0138] Here, sigId represents the signal identifier or macro identifier of the signal to be written to the global signal pool, psigvar represents a pointer to the address to be written to the global signal pool, and siglen represents the length of the signal to be written to the global signal pool. The return value of this interface can include 0 and non-zero values. A return value of 0 indicates that the signal has been successfully written to the global signal pool, while a non-zero return value indicates that the signal writing to the global signal pool has failed.
[0139] For example, when calling the above data writing interface, its input parameters can be checked. For instance, if SigId does not match the macro identifier corresponding to the signal identifier, or pSigVar does not match the address of the variable of the data type of the signal defined in GSP, or sigLen and the length of the variable indicated by psigVar are inconsistent, the signal writing will fail. In the case of signal writing failure, a signal writing failure log can be generated and output.
[0140] For example, if the second signal does not contain the first signal, the process of reading the first signal from the global signal pool can be performed synchronously with the process of writing the second signal into the global signal pool, or the execution order of the two processes can be adjusted. This application embodiment does not limit this. However, if the second signal contains the first signal, the operation of writing the second signal into the global signal pool needs to be performed before reading the first signal from the global signal pool.
[0141] As can be seen from the above, the signal association method provided in this application, after determining the second signal to be written to the global signal pool by the third service component, if the second signal is a single signal in the second signal set managed by the third service component, then based on the second set identifier of the second signal set, the second signal is written to the second cache space of the third application. In this way, the second signal is cached in the second cache space, and the mutual isolation between the third service component and the global signal pool is also realized. Furthermore, through the third transmission interface associated with the global signal pool, based on the second application identifier and the second set identifier of the third application, the second signal stored in the second cache space is written to the global signal pool. In this way, the accuracy and stability of writing the second signal to the global signal pool can be improved, and data support is also provided for other components to obtain and associate the second signal from the global signal pool.
[0142] Based on the foregoing embodiments, in the signal association method provided in this application, after writing the second signal into the second cache space of the third application, the following operations can be performed:
[0143] Set the read / write status of the second cache space to the written state;
[0144] Accordingly, after writing the second signal stored in the second buffer space into the global signal pool, the following operations can also be performed:
[0145] Set the read / write status of the second cache space to "read".
[0146] For example, after writing the second signal into the second cache space, the read / write status of the second cache space or the storage unit in the second cache space used to store the second signal can be set to the written state. At this time, the third service component cannot write any signal to the storage unit, thereby protecting the data integrity of the second signal. Correspondingly, after writing the second signal stored in the second cache space into the global signal pool, the read / write status of the second cache space or the storage unit in the second cache space that originally stored the second signal can be set to the read state. This means that the storage unit in the second cache space that stored the second signal is released, that is, the third service component can write other single signals to the storage unit again.
[0147] As can be seen from the above, the signal association method provided in this application sets the read / write state of the second cache space to the written state after writing the second signal into the second cache space of the third application, and sets the read / write state of the second cache space to the read state after writing the second signal stored in the second cache space into the global signal pool. Thus, by setting the read / write state of the second cache space, precise protection of the integrity of the second signal in the second cache space is achieved, and real-time release of the second cache space is also realized, providing conditions for the third service component or the third application to write signals into the second cache space again.
[0148] Based on the foregoing embodiments, the signal association method provided in this application can also perform the following operations:
[0149] If the second signal is any of the signals in the second signal set managed by the third service component, then all signals in the second signal set are written into the global signal pool based on the second application identifier.
[0150] Accordingly, if the second signal is a single signal in the second signal set, the second signal can be written into the second buffer space first, and then written into the global signal pool from the second buffer space, using the method provided in the aforementioned embodiments.
[0151] For example, if the second signal is all the signals in the second signal set, then the second signal set will be written directly to the global signal pool as a signal group, without having to write it to the second buffer space first, and then transfer the second signal set to the global signal pool through the second buffer space.
[0152] For example, based on the second association relationship and the second application identifier, the storage address in the global signal pool used to store the signal corresponding to the second application can be determined, and the address in the above storage address that can be written to the second signal set can be determined as the write address of the second signal set. Then, based on the write address, the third transmission interface can be called to write the second signal set into the global signal pool.
[0153] Figure 4 This is a schematic diagram of the signal association structure provided in the embodiments of this application, such as... Figure 4As shown, if Service1 in APP-1 301 needs to access member S21 of signal group SG2 in APP-2 302, it can copy S21 from signal group SG2 in GSP to the cache area of APP-1 through the API read interface associated with GSP, and set GSP2CacheFlg to the written state to indicate that S21 in SG2 has been copied from GSP to the cache area in this cycle. At this time, S21 in the cache area can be returned to Service1 through API. The read / write state can include GSP2CacheFlg, and Service1 can be the service component in the aforementioned embodiment.
[0154] For example, if Service1 in APP-1 reads the S21 signal in SG2 through the API, since GSP2CacheFlg is already set to the written state, it can directly read the value of S21 from the cache, and after the read operation is completed, set GSP2CacheFlg to the read state.
[0155] For example, when Service1 in APP-1 needs to write S13 of SG1 through API, it can first write S13 to S13 in SG1 in the cache area and set the cache area Cache2GSPFlg to the written state; for example, the read and write state can also include Cache2GSPFlg.
[0156] For example, if Service1 in APP-1 still needs to write S11 in SG1, S11 can be written to the storage unit corresponding to S11 in SG1 in the cache area, and check whether Cache2GSPFlg has been set to the written state. If it has not been set to the written state, then the Cache2GSPFlg is set to the written state. For example, when Service1 in APP-1 finishes running, it can switch to Service2 to run, at which time Flush will be executed.
[0157] For example, after S11 and S13 in SG1 are written into the cache area, when it is determined that Cache2GSPFlg is in a written state, a spinlock can be opened based on this written state. Then, the signal of SG1 in the cache area is copied to SG1 of GSP, and Cache2GSPFlg is set to a read state. During the above process, S12 in SG1 will remain unchanged.
[0158] For example, Service1 in APP-1 can directly read the entire signal group SG2 of APP-2 through the API associated with GSP; and Service1 in APP-1 can write to the entire signal group SG1 through the API. In the above process, a spinlock can be enabled by means of the read and write states to protect the data integrity in the signal group.
[0159] As can be seen from the above, the signal association method provided in this application embodiment, if the second signal is all the signals in the second signal set managed by the third service component, writes all the signals in the second signal set into the global signal pool based on the second application identifier. When the second signal set is a signal group, the above operations can efficiently and flexibly write the signal group managed by the third service component into the global signal pool, improving the consistency and association between signals in the signal group, thereby providing data support for sharing signal groups between different signal components.
[0160] In this embodiment, the first to third service components can be associated with the vehicle's SOA and AUTOSAR respectively, thereby enabling transmission and association between different architectures in SOA and AUTOSAR at the level of single signals and signal groups. This achieves seamless compatibility between the two architectures in the signal transmission and association dimensions, enabling more efficient and unified signal management and dynamic configuration, and facilitating efficient signal interaction across components and services. Simultaneously, by setting read / write states, data security during the read / write process of single signals and signal groups can be improved. Furthermore, by leveraging APIs to achieve the transmission and sharing of signals and signal groups, the scalability of service components with different architectures in the vehicle is enhanced.
[0161] In the embodiments of this application, when the first to third transmission interfaces are APIs, the reusable APIs can simplify the read and write operations of single signals and signal groups, realize efficient signal read and write interactions across service components and architectures, thereby reducing the complexity of function development and improving the readability and usability of the overall system architecture.
[0162] Furthermore, single-signal read / write operations reduce the load on the vehicle's central processing unit (CPU) and memory, allowing resources to be more focused on other tasks, making it particularly suitable for resource-constrained embedded systems. This operation also reduces waiting and processing time, significantly lowers latency, and improves system response speed and real-time performance, thereby enhancing responsiveness to dynamic changes in demand and supporting more refined signal management and control. Simultaneously, the code logic for single-signal processing is relatively simplified, making debugging and maintenance more efficient, reducing overall system complexity, and facilitating system expansion and functional iteration.
[0163] It should be noted that the technical solutions provided in this application can serve as a supplementary solution for signal transmission and sharing in AUTOSAR, without having to abandon the signal transmission mechanism in AUTOSAR.
[0164] This application also provides a signal correlation device. Figure 5 This is a schematic diagram of the structure of the signal correlation device provided in the embodiments of this application, such as... Figure 5 As shown, the signal correlation device 5 may include:
[0165] The determining module 501 is used to determine a first signal to be accessed by the first service component; wherein the first signal includes signals managed by the second service component;
[0166] The transmission module 502 is used to obtain a first signal from the global signal pool through a first transmission interface associated with the global signal pool; wherein the global signal pool stores a set of signals managed by the vehicle's service components.
[0167] The association module 503 is used to associate the first signal with the first service component so that the first service component can perform data processing operations based on the first signal.
[0168] In some embodiments, the transmission module 502 is configured to write the first signal to the first cache space of the first application through the second transmission interface if the first signal is a single signal; wherein the first service component is configured to implement at least some of the functions of the first application.
[0169] The transmission module 502 is also configured to read the first signal from the first buffer space to associate the first signal with the first service component.
[0170] In some embodiments, the transmission module 502 is configured to, after writing the first signal to the first cache space of the first application through the second transmission interface, set the read / write state of the first cache space to the written state; and after reading the first signal from the first cache space, set the read / write state of the first cache space to the read state.
[0171] In some embodiments, the transmission module 502 is configured to: if the first signal is a single signal in a first signal set managed by the second service component, obtain a first application identifier of the second application; and obtain the first signal from a global signal pool based on the first application identifier, a first set identifier of the first signal set, and a first signal identifier of the first signal; wherein the second service component is configured to implement at least some of the functions of the second application.
[0172] In some embodiments, the transmission module 502 is configured to, if the first signal is all the signals in the first signal set managed by the second service component, obtain the first application identifier of the second application associated with the second service component; and, based on the first application identifier and the first set identifier of the first signal set, obtain all the signals in the first signal set from the global signal pool.
[0173] In some embodiments, the transmission module 502 is configured to determine a second signal to be written to the global signal pool by the third service component; if the second signal is a single signal in the second signal set managed by the third service component, the second signal is written to the second cache space of the third application based on the second set identifier of the second signal set; and the second signal stored in the second cache space is written to the global signal pool through a third transmission interface associated with the global signal pool based on the second application identifier and the second set identifier of the third application; wherein the third service component is used to implement at least some of the functions of the second application.
[0174] In some embodiments, the transmission module 502 is configured to, after writing the second signal into the second cache space of the third application, set the read / write state of the second cache space to a written state; after writing the second signal stored in the second cache space into the global signal pool, the method further includes:
[0175] Set the read / write status of the second cache space to "read".
[0176] In some embodiments, the transmission module 502 is configured to write all signals in the second signal set into the global signal pool based on the second application identifier if the second signal is all signals in the second signal set managed by the third service component.
[0177] This application also provides an electronic device. Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 6 As shown, the electronic device 6 includes a processor 601 and a memory 602; the memory stores a computer program; when the computer program is executed by the processor, it can implement the signal association method as described above.
[0178] This application also provides a computer-readable storage medium storing a computer program; when the computer program is executed by a processor of an electronic device, it can implement the signal association method as described above.
[0179] This application also provides a computer program product, which includes a computer program; when the computer program is executed by a processor of an electronic device, it can implement the signal association method as described above.
[0180] In some embodiments, the computer-readable storage medium may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it may be a device that includes one or any combination of the above-mentioned memories.
[0181] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
[0182] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).
Claims
1. A signal correlation method, characterized in that, The method includes: Determine a first signal to be accessed by the first service component; wherein the first signal includes signals managed by the second service component; The first signal is obtained from the global signal pool through a first transmission interface associated with the global signal pool; wherein the global signal pool stores a set of signals managed by the vehicle's service components; The first signal is associated with the first service component so that the first service component can perform data processing operations based on the first signal.
2. The method according to claim 1, characterized in that, Associating the first signal with the first service component includes: If the first signal is a single signal, the first signal is written to the first cache space of the first application through the second transmission interface; wherein, the first service component is used to implement at least some of the functions of the first application; The first signal is read from the first cache space to associate the first signal with the first service component.
3. The method according to claim 2, characterized in that, After writing the first signal to the first cache space of the first application through the second transmission interface, the method further includes: Set the read / write status of the first cache space to the written state; After reading the first signal from the first buffer space, the method further includes: Set the read / write status of the first cache space to "read".
4. The method according to any one of claims 1 to 3, characterized in that, Obtaining the first signal from the global signal pool includes: If the first signal is a single signal in the first signal set managed by the second service component, obtain the first application identifier of the second application; wherein, the second service component is used to implement at least some of the functions of the second application; The first signal is obtained from the global signal pool based on the first application identifier, the first set identifier of the first signal set, and the first signal identifier of the first signal.
5. The method according to any one of claims 1 to 4, characterized in that, Obtaining the first signal from the global signal pool includes: If the first signal is any of the signals in the first signal set managed by the second service component, obtain the first application identifier of the second application associated with the second service component; Based on the first application identifier and the first set identifier of the first signal set, all signals in the first signal set are obtained from the global signal pool.
6. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Determine the second signal to be written to the global signal pool by the third service component; If the second signal is a single signal in the second signal set managed by the third service component, the second signal is written into the second cache space of the third application based on the second set identifier of the second signal set; wherein, the third service component is used to implement at least some of the functions of the third application; The second signal stored in the second cache space is written into the global signal pool through the third transmission interface associated with the global signal pool, based on the second application identifier and the second set identifier of the third application.
7. The method according to claim 6, characterized in that, After writing the second signal into the second cache space of the third application, the method further includes: Set the read / write status of the second cache space to the written state; After writing the second signal stored in the second buffer space into the global signal pool, the method further includes: Set the read / write status of the second cache space to "read".
8. The method according to claim 6, characterized in that, The method further includes: If the second signal is any of the signals in the second signal set managed by the third service component, then all the signals in the second signal set are written into the global signal pool based on the second application identifier.
9. A signal correlation device, characterized in that, The signal correlation device includes: The determining module is used to determine a first signal to be accessed by the first service component; wherein the first signal includes signals managed by the second service component; A transmission module is configured to acquire the first signal from the global signal pool via a first transmission interface associated with the global signal pool; wherein the global signal pool stores a set of signals managed by the vehicle's service components; The association module is used to associate the first signal with the first service component, so that the first service component can perform data processing operations based on the first signal.
10. An electronic device, characterized in that, The electronic device includes a processor and a memory; the memory stores a computer program; when the computer program is executed by the processor, it is able to implement the signal association method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The storage medium stores a computer program; when the computer program is executed by the processor of the electronic device, it is able to implement the signal association method as described in any one of claims 1 to 8.
12. A computer program product, characterized in that, The program product includes a computer program; when the computer program is executed by a processor of an electronic device, it is capable of implementing the signal association method as described in any one of claims 1 to 8.