Data processing methods, apparatus, equipment, and media based on SOMEIP
By generating and sending specific subscription messages in the SOMEIP protocol stack, the client is ensured to receive the initial data value after receiving the subscription success notification signal from the server. This solves the problems of high event packet loss rate and field notify initial value determination, and improves communication efficiency.
Patent Information
- Application Number
- CN202411189821.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-08-28
AI Technical Summary
In the SOMEIP protocol stack, the high packet loss rate of Events and the problem of initial value determination of Field Notification seriously affect the communication efficiency in communication between the client and the server.
By obtaining the initial state change data of the target event group on the client, determining the candidate state change data based on the preset subscription call parameters, generating the first and second subscription messages, and receiving the initial data value after receiving the subscription success notification signal from the server, the system ensures accurate reception of the initial value.
It effectively reduced the packet loss rate of Events, solved the problem of initial value determination in Field Notification, and improved the communication efficiency between the server and the client.
Smart Images

Figure CN119211372B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle communication technology, and in particular to a data processing method, apparatus, device and medium based on SOMEIP. Background Technology
[0002] As autonomous driving technology in intelligent connected vehicles becomes increasingly complex, in the field of software development for the microprocessor unit (MPU) of the vehicle controller, a communication scheme based on service-oriented middleware technology (Scalable Service-Oriented Middleware over IP, SOMEIP) is typically used for communication design. This is usually applicable to communication scenarios between the server and client based on the SOMEIP protocol stack, such as communication between events and fields.
[0003] In related technologies, the SOMEIP interface typically subscribes to events or field notifications (i.e., notifications related to fields) at the interface level. SOMEIP business messages, on the other hand, are usually subscribed to in event groups. When one event / field notification begins subscription on a client side, the server assumes all events / field notifications have been subscribed to and sends initial values to all of them. This can easily lead to unsubscribed events or field notifications not receiving accurate initial values, resulting in a high packet loss rate for events and potential initial value determination issues for field notifications, thus impacting communication efficiency between the server and client. Therefore, reducing the packet loss rate of events and resolving the initial value determination problem for field notifications to improve communication efficiency between the server and client has become a pressing technical issue. Summary of the Invention
[0004] The main objective of this application is to propose a data processing method, apparatus, device, and medium based on SOMEIP, which aims to reduce the packet loss rate of Events and solve the initial value determination problem of Field Notification, thereby improving the communication efficiency between the server and the client.
[0005] To achieve the above objectives, a first aspect of this application proposes a data processing method based on SOMEIP, applied to a client, wherein the client and server are in a communication connection, and the method includes:
[0006] Obtain the target event group corresponding to the communication service requirements in the target network communication; wherein, the target event group includes multiple initial state change data, and the initial state change data is used to indicate the event or field notification of the state change in the target network communication;
[0007] Candidate state change data are determined from multiple initial state change data based on preset subscription call parameters;
[0008] A first subscription message is generated based on the candidate state change data and the target event group;
[0009] Based on the remaining initial state change data and the target event group, at least one second subscription message is generated, and the first subscription message and the second subscription message are sent to the server.
[0010] Upon receiving the subscription success notification signal from the server in response to the first subscription message, the system receives the initial data value corresponding to each of the initial state change data sent by the server.
[0011] In some embodiments, generating the first subscription message based on the candidate state change data and the target event group includes:
[0012] The candidate state change data is labeled with preset tags to obtain the target state change data.
[0013] The first subscription message is generated based on the target state change data and the target event group.
[0014] In some embodiments, determining candidate state change data from a plurality of initial state change data based on preset subscription call parameters includes:
[0015] Based on preset subscription call parameters, multiple initial state change data are arranged to obtain a state change data list, which is used to indicate the order in which the multiple initial state change data call the preset subscription call parameters;
[0016] The candidate state change data is determined based on the state change data list. The candidate state change data is used to characterize the initial state change data of the last caller of the preset subscription call parameters in the target event group.
[0017] In some embodiments, the preset subscription invocation parameters include business logic data, data dependencies, data priorities, and resource constraint data corresponding to communication service requirements; the step of arranging multiple initial state change data based on the preset subscription invocation parameters to obtain a state change data list includes...
[0018] Based on the business logic data, the initial state change data is scored to obtain a first score;
[0019] Based on the data dependencies, the initial state change data is scored to obtain a second score;
[0020] Based on the data priority, the initial state change data is scored to obtain a third score;
[0021] Based on the resource constraint data, the initial state change data is scored to obtain a fourth score;
[0022] The target score for the initial state change data is determined based on the first score, the second score, the third score, and the fourth score.
[0023] Based on the target score, the multiple initial state change data are sorted in descending order to obtain the state change data list.
[0024] In some embodiments, obtaining the target event group corresponding to the communication service requirements in the target network communication includes:
[0025] The communication service requirements in the target network communication are parsed to obtain service-related data and service scenario data. The service-related data is used to indicate event or field notifications related to the business logic of the communication service requirements, and the service scenario data is used to indicate event or field notifications related to the scenario corresponding to the communication service requirements.
[0026] Based on the business-related data and business scenario data, multiple initial state change data are obtained from the preset state dataset, and the target event group is constructed based on the multiple initial state change data.
[0027] To achieve the above objectives, a second aspect of this application proposes a data processing method based on SOMEIP, applied to a server, wherein the server and client are connected in a communication connection, and the method includes:
[0028] Receive candidate subscription messages based on target event groups sent by the client; wherein, the candidate subscription message includes a first subscription message and a second subscription message, the first subscription message is used to indicate candidate state change data determined from multiple initial state change data of the target event group, and the second subscription message is used to indicate the remaining initial state change data in the target event group;
[0029] When the candidate subscription message is the first subscription message, a subscription success notification signal is sent to the client, and the initial data value corresponding to each initial state change data in the target event group is sent to the client.
[0030] In some embodiments, before sending a subscription success notification signal to the client when the candidate subscription message is the first subscription message, the method further includes:
[0031] The candidate subscription message is parsed to obtain parsed data, which includes parsed tags;
[0032] Tag detection is performed on the candidate subscription messages based on preset tags and the parsed tags to obtain tag detection results;
[0033] Based on the tag detection results, the candidate subscription message is determined to be either the first subscription message or the second subscription message.
[0034] To achieve the above objectives, a third aspect of this application provides a data processing apparatus based on SOMEIP, the apparatus comprising:
[0035] The acquisition module is used to acquire target event groups corresponding to communication service requirements in the target network communication; wherein, the target event group includes multiple initial state change data, and the initial state change data is used to indicate events or field notifications that have undergone state changes in the target network communication;
[0036] The determination module is used to determine candidate state change data from multiple initial state change data based on preset subscription call parameters;
[0037] The first message generation module is used to generate a first subscription message based on the candidate state change data and the target event group;
[0038] The second message generation module is used to generate at least one second subscription message based on the remaining initial state change data and the target event group, and send the first subscription message and the second subscription message to the server.
[0039] The first receiving module is configured to receive the initial data value corresponding to each initial state change data sent by the server after receiving the subscription success notification signal from the server based on the first subscription message.
[0040] To achieve the above objectives, a fourth aspect of this application provides an electronic device, comprising: at least one processor; at least one memory for storing at least one program; wherein when the at least one program is executed by the at least one processor, the at least one processor implements a SOMEIP-based data processing method as described in the first aspect above; or, a SOMEIP-based data processing method as described in the second aspect above.
[0041] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a SOMEIP-based data processing method as described in the first aspect above; or, a SOMEIP-based data processing method as described in the second aspect above.
[0042] This application proposes a SOMEIP-based data processing method, apparatus, device, and medium. The method only receives the initial data value corresponding to each initial state change data sent by the server after receiving a subscription success notification signal based on a first subscription message response at the server end. Specifically, the client obtains a target event group corresponding to the communication service requirements in the target network communication. This target event group includes multiple initial state change data, which are used to indicate events or field notifications of state changes occurring in the target network communication. Further, candidate state change data is determined from the multiple initial state change data based on preset subscription call parameters. Further, a first subscription message is generated based on the candidate state change data and the target event group. At least one second subscription message is generated based on the remaining initial state change data and the target event group, and the first and second subscription messages are sent to the server. Further, upon receiving the subscription success notification signal from the server based on the first subscription message response, the client receives the initial data value corresponding to each initial state change data sent by the server. The first subscription message in this application embodiment is a message generated by this application based on a pre-determined event or field notification with specific meaning. It can accurately indicate the subscription status sent by the client to the server. Therefore, this application will only receive the accurate initial data value sent by the server after receiving the subscription success notification signal from the server based on the first subscription message. This can effectively reduce the packet loss rate of Event and solve the problem of initial value determination of Field Notification, thereby improving the communication efficiency between the server and the client. Attached Figure Description
[0043] Figure 1 This is the first flowchart of the data processing method based on SOMEIP provided in the embodiments of this application;
[0044] Figure 2 yes Figure 1 A flowchart of step S110 in the process;
[0045] Figure 3 yes Figure 1 A flowchart of step S120 in the process;
[0046] Figure 4 yes Figure 3 A flowchart of step S310 in the process;
[0047] Figure 5 yes Figure 1 A flowchart of step S130 in the process;
[0048] Figure 6 This is the second flowchart of the SOMEIP-based data processing method provided in the embodiments of this application;
[0049] Figure 7 This is the third flowchart of the SOMEIP-based data processing method provided in the embodiments of this application;
[0050] Figure 8 This is an interaction diagram of the SOMEIP-based data processing method provided in the embodiments of this application;
[0051] Figure 9 This is a schematic diagram of a data processing device based on SOMEIP provided in an embodiment of this application;
[0052] Figure 10 This is another schematic diagram of the data processing device based on SOMEIP provided in the embodiments of this application.
[0053] Figure 11 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0055] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0057] First, let's analyze some of the terms used in this application:
[0058] Scalable Service-Oriented Middleware over IP (SOMEIP) is an automotive embedded communication protocol primarily used for control message communication. It supports remote service invocation, service publishing / subscription, serialization, and service discovery. SOMEIP is an IP-based service-oriented middleware that enables efficient service exchange and remote invocation.
[0059] An event is a signal that a specific action or state change has occurred. In event-driven programming, events can be detected by subscribers, and when an event occurs, all subscribers to that event will receive a notification. For example, a user clicking a button or a network request successfully returning data are events. Event communication is widely used in vehicle dynamic monitoring, fault diagnosis, and safety warnings. For instance, when a vehicle's tire pressure changes, the sensor generates an event message and sends it to the vehicle control system via the SOMEIP protocol so that appropriate measures can be taken.
[0060] A field is a representation of an object's attributes, used to store the object's state information. In object-oriented programming, fields are typically member variables of a class, accessible and modified through getter and setter methods. Fields can contain various data types, such as integers, strings, and boolean values. Field communication is widely used in vehicle control systems, comfort systems, and entertainment systems. For example, in autonomous driving systems, sensors and control units need to exchange information such as vehicle position, speed, and direction in real time via field communication to achieve precise control. Therefore, the Event and Field communication scenarios developed based on the SOMEIP protocol stack cover various data interaction needs between different components in automotive networks, providing strong support for realizing intelligent and efficient in-vehicle systems.
[0061] Field Notification is a special mechanism used to notify relevant subscribers when a field's value changes. When a field's value changes, the system automatically triggers a notification, alerting all subscribers who have subscribed to that field's change. This mechanism is typically used to implement data binding and data synchronization, ensuring that UI components reflect data changes in real time.
[0062] Service: In SOMEIP, a service is an entity that provides specific functionality or operations. Clients can subscribe to events within a service to receive notifications when those events occur.
[0063] Microprocessor Unit (MPU): In the automotive field, MPU usually refers to a highly integrated chip that can perform complex computing tasks and logic control, and is one of the core components of automotive electronic systems.
[0064] As autonomous driving technology in intelligent connected vehicles becomes increasingly complex, communication design in areas such as the software development of the microprocessor unit (MPU) in automotive controllers typically employs a service-oriented middleware over IP (SOMEIP) communication scheme based on network protocols. This is generally suitable for communication scenarios involving events and fields between servers and clients developed using the SOMEIP protocol stack. However, this necessitates that developers have a clear understanding of the event, method, and field design schemes within the SOMEIP framework and ensure the real-time performance and stability of communication.
[0065] In related technologies, the SOMEIP interface typically subscribes to events or field notifications (i.e., notifications related to fields) at the interface level, while SOMEIP business messages are usually subscribed to in event groups. When one event / field notification on a client begins subscribing, the server assumes that all events / field notifications have been subscribed to and sends initial values to all events / field notifications. This can easily lead to unsubscribed events or field notifications not receiving accurate initial values, resulting in a high packet loss rate for events and potential initial value determination issues for field notifications, thus impacting communication efficiency between the server and client. Furthermore, related technologies have proposed generating configuration files for running code files by inputting the service ID, the event group ID to which the method belongs, and communication configuration information into a pre-made configuration template using a configuration generation script, but they do not explain how to design and optimize the service. Therefore, how to reduce the packet loss rate of events and solve the initial value determination problem of field notifications, thereby improving the communication efficiency between the server and client, has become an urgent technical problem to be solved.
[0066] Based on this, embodiments of this application provide a data processing method, apparatus, device, and medium based on SOMEIP, aiming to reduce the packet loss rate of Events and solve the initial value determination problem of Field Notification, thereby improving the communication efficiency between the server and the client.
[0067] The SOMEIP-based data processing method provided in this application can be applied to a terminal, a server, or software running on a terminal (i.e., a client) or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms; the software can be an application implementing the SOMEIP-based data processing method, but is not limited to the above forms. Therefore, if the SOMEIP-based data processing method provided in this application is applied to a server, the server can communicate with at least one in-vehicle terminal.
[0068] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers (PCs), minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0069] In some embodiments, please refer to Figure 1 , Figure 1 This is an optional flowchart of a SOMEIP-based data processing method provided in this application embodiment. The SOMEIP-based data processing method applied to the client may include, but is not limited to, steps S110 to S150:
[0070] Step S110: Obtain the target event group corresponding to the communication service requirements in the target network communication;
[0071] Step S120: Based on preset subscription call parameters, candidate state change data are determined from multiple initial state change data;
[0072] Step S130: Generate the first subscription message based on the candidate state change data and the target event group;
[0073] Step S140: Generate at least one second subscription message based on the remaining initial state change data and target event group, and send the first subscription message and the second subscription message to the server.
[0074] Step S150: After receiving the subscription success notification signal from the server based on the first subscription message response, receive the initial data value corresponding to each initial state change data sent by the server.
[0075] Steps S110 to S150 of the embodiments of this application determine candidate state change data from multiple initial state change data in the target event group to generate a first subscription message and at least one second subscription message. Then, based on the subscription success notification signal received from the server based on the first subscription message, the initial data value is further received. This focuses on scenarios with multiple Events and Field Notifications under the same service, and specifically discloses how to design an event group and the subscription and communication logic for Events and Field Notifications in the event group. This reduces the packet loss rate of Events and can solve the problem that the initial values of Events and Field Notifications cannot be normally received by the client after service discovery is established.
[0076] In step S110 of some embodiments, the target event group refers to a collection of multiple event / field notifications under the same service corresponding to the communication service requirements in the target network communication. Communication service requirements define the user's expectations for the communication service, including speed, stability, and security. Service discovery is a technology in communication systems that allows service instances to be dynamically registered and discovered, thereby improving the system's flexibility and scalability. The target network communication refers to communication established between the server and client based on SOMEIP. The target event group includes multiple initial state change data, and each initial state change data is used to indicate an event or field notification (Event / FieldNotify) indicating a state change in the target network communication.
[0077] It's important to note that multiple event / field notifications within the same service mean that a single service can contain multiple different events and fields. For example, suppose there's a service named "CarService" that could include the following events: "engine_started," triggered when the engine starts; and "speed_changed," triggered when the vehicle speed changes. It could also include the following fields: "current_speed," representing the current vehicle speed; and "fuel_level," representing the remaining fuel level. In this way, clients can subscribe to these event / field notifications to receive corresponding notifications, and can also read or modify the values of these fields to understand the vehicle's status.
[0078] It should be noted that designing an event group that includes only one Event / Field Notify would increase the bandwidth requirements of Ethernet and does not conform to the design concept of a Group. Therefore, the target event group in this application includes multiple initial state change data, which can alleviate the bandwidth pressure on Ethernet and improve communication efficiency.
[0079] It's important to note that an event group can contain multiple Event / Field Notifications. With current technology, when a client subscribes to an Event / Field Notification, because subscriptions are done at the event group level, the server assumes all Event / Field Notifications have been subscribed and sends initial values to all of them. However, for the client, the corresponding interface can only receive the initial value from the server after the client sends the subscription message for the Event / Field Notification generated at the event group level. Otherwise, it cannot receive the initial value. Therefore, since many Event / Field Notifications haven't been subscribed to and cannot receive the initial values from the server, some initial values may be lost. Furthermore, clients typically need to make logical judgments based on whether the initial values of Event / Field Notifications have changed. However, if the initial values of Event / Field Notifications are not received initially, the client cannot accurately identify when the values have changed.
[0080] It should be noted that in practical applications, reducing the packet loss rate of Events and resolving the issue of the client not being able to properly receive the initial values of Events and Field Notifications after service discovery is established can effectively solve problems such as synchronization in actual communication (i.e., the receiver needs the correct initial value to synchronize with the sender; if the initial value is lost, the receiver may not be able to synchronize correctly with the sent signal, leading to data parsing errors), data integrity damage (i.e., initial values are usually used to set the initial state of communication; if this state is lost or incorrect, it may lead to incorrect interpretation of subsequent data streams, affecting data integrity), performance degradation (i.e., in communication systems that need to initialize certain parameters, such as encryption keys or session parameters, the loss of initial values may lead to reduced communication efficiency because the system may need to renegotiate these parameters), resource waste (i.e., when trying to retrieve the lost initial value, additional time and computing resources may be consumed, which is particularly problematic in some systems with high real-time requirements), user experience degradation (i.e., for end users, the loss of communication initial values may lead to service interruption, delay, or other forms of service quality degradation), and error propagation (i.e., in some systems, incorrect initial values may cause a chain reaction, affecting the normal operation of other parts of the system).
[0081] In some embodiments, please refer to Figure 2 , Figure 2 This is an optional flowchart of step S110 provided in the embodiments of this application. Step S110 may specifically include, but is not limited to, steps S210 to S220:
[0082] Step S210: Perform data parsing on the communication service requirements in the target network communication to obtain service-related data and service scenario data;
[0083] Step S220: Obtain multiple initial state change data from the preset state dataset based on business-related data and business scenario data, and construct a target event group based on the multiple initial state change data.
[0084] In step S210 of some embodiments, when constructing an event group, all Event / Field Notifications under the same service can be designed into the same event group according to communication service requirements. In this case, the communication service requirements in the target network communication can be parsed first to obtain service-related data and service scenario data. Among them, the service-related data is used to indicate event or field notifications related to the business logic of the communication service requirements, and the service scenario data is used to indicate event or field notifications related to the scenario corresponding to the communication service requirements.
[0085] It should be noted that communication service requirements refer to the goals that the organization setting up the service hopes to achieve. Service-related data can refer to the relationship between the communication service requirement and other services or services. Service scenario data can refer to the scenario information required to realize the communication service requirement, reflecting the performance and requirements of the communication service in different scenarios. This embodiment of the disclosure, through data parsing of communication service requirements in the target network communication, can obtain service-related data and service scenario data that are of great significance for optimizing communication services, improving communication efficiency, and enhancing communication security.
[0086] In step S220 of some embodiments, multiple initial state change data are further obtained from a preset state dataset based on business-related data and business scenario data, and a target event group is constructed based on the multiple initial state change data. The preset state dataset refers to a pre-constructed collection that includes complete Event / Field Notifications. Therefore, state change data that matches the business-related data and business scenario data can be used as initial state change data to construct the target event group.
[0087] In the above embodiments, this application can centralize all related events and field notifications into one event group, which helps to simplify synchronization logic, improve system efficiency, and facilitate code management and maintenance.
[0088] In step S120 of some embodiments, the preset subscription invocation parameter refers to a parameter pre-set for determining candidate state change data from multiple initial state change data. The candidate state change data is a specific Event / Field Notify selected by this application from multiple initial state change data, used to trigger the subscription of subsequent target event groups, that is, to let the server know whether to send the initial value corresponding to each Event / Field Notify in the target event group to the client.
[0089] In some embodiments, please refer to Figure 3 , Figure 3 This is an optional flowchart of step S120 provided in the embodiments of this application. Step S120 may specifically include, but is not limited to, steps S310 to S320:
[0090] Step S310: Arrange multiple initial state change data based on preset subscription call parameters to obtain a state change data list;
[0091] Step S320: Determine candidate state change data based on the state change data list.
[0092] In steps S310 and S320 of some embodiments, when determining candidate state change data, this application may first arrange multiple initial state change data based on preset subscription call parameters to obtain a state change data list. This state change data list is used to indicate the order in which the preset subscription call parameters are invoked by the multiple initial state change data. Further, candidate state change data is determined from the state change data list, and this candidate state change data is used to characterize the last initial state change data in the target event group to invoke the preset subscription call parameters.
[0093] It should be noted that each preset subscription call parameter corresponds to a subscription function. In other words, the candidate state change data is used to characterize the initial state change data of the last call to the set subscription function in the target event group. When the subscription function is called, the initial state change data follows the SOMEIP design specification, subscribing to events on an event / field notification basis. However, when sending the data to the server, subscription messages are sent on an event group basis.
[0094] In some embodiments, the preset subscription call parameters can be the parameters corresponding to the standard subscription function. In this case, the calls to the initial state change data in the target event group can be sorted according to the parameters corresponding to the standard subscription function, and the initial state change data of the last call to the standard subscription function can be determined as the specific candidate state change data. In this way, it can be ensured that the Event / Notify in the target event group can obtain the initial value.
[0095] It's important to note that in communication, a subscription function typically refers to a function that allows one entity (subscriber) to register and receive messages from another entity (publisher). This type of function is a core component of the publish / subscribe pattern and is widely used in software engineering, especially in scenarios requiring decoupling and asynchronous communication between components.
[0096] In other embodiments, the preset subscription call parameters can also be parameters corresponding to a subscription function customized according to communication service requirements. In this case, the preset subscription call parameters include business logic data, data dependencies, data priorities, and resource limit data corresponding to the communication service requirements. For example, subscribers can be allowed to subscribe to specific topics based on their interests, and when a message on a corresponding topic is published, the subscriber can receive the message. This function plays a key role in the publish / subscribe pattern, enabling flexible message distribution and reception.
[0097] Please see Figure 4 , Figure 4 This is an optional flowchart of step S310 provided in the embodiments of this application.
[0098] Step S310 may specifically include, but is not limited to, steps S410 to S460:
[0099] Step S410: Based on the business logic data, score the initial state change data to obtain the first score;
[0100] Step S420: Based on the data dependency relationship, score the initial state change data to obtain the second score;
[0101] Step S430: Based on data priority, score the initial state change data to obtain the third score;
[0102] Step S440: Based on the resource constraint data, score the initial state change data to obtain the fourth score;
[0103] Step S450: Determine the target score for the initial state change data based on the first score, the second score, the third score, and the fourth score;
[0104] Step S460: Sort the multiple initial state change data in descending order based on the target score to obtain a list of state change data.
[0105] In steps S410 to S440 of some embodiments, business logic data is used to indicate the order of business logic. This means that when arranging, the logical order of initial state change data in the actual business process can be considered; that is, the earlier the logical order in the actual business process, the higher the corresponding first score may be. Data dependency is used to indicate that some event / field notifications may depend on the results of other events or notifications. This means that when arranging, it is necessary to ensure that those event / field notifications that are dependencies are processed first; that is, the second score corresponding to event / field notifications that are dependencies may be higher. Data priority is used to indicate the priority of different event / field notifications, wherein high-priority event / field notifications should be processed before low-priority events or notifications. This means that when arranging, the third score corresponding to high-priority event / field notifications may be higher. Resource constraint data is used to indicate resource constraints that may be encountered when processing event / field notifications, such as insufficient memory or high CPU utilization. In this case, it is necessary to weigh the use of resources and reasonably arrange the processing order of event / field notifications. Thus, when arranging, the fourth score corresponding to event / field notifications with higher resource constraints may be higher. It should be noted that the data scoring under different conditions can be flexibly selected and adjusted according to the actual situation. For example, in order to handle more events or field notifications, the fourth score corresponding to the event / field notification with higher resource constraints can be set lower, which is not limited here.
[0106] In steps S450 and S460 of some embodiments, this application can set corresponding weights for the parameters included in the preset subscription call parameters. Thus, after obtaining the first, second, third, and fourth scores corresponding to each initial state change data, a weighted sum can be calculated based on the first, second, third, and fourth scores and their corresponding weights to determine the target score corresponding to each initial state change data. Furthermore, by sorting the multiple initial state change data in descending order based on the target scores, a state change data list can be obtained, thereby determining the candidate state change data for the last call to the subscription function from the state change data list.
[0107] It should be noted that the preset subscription call parameters of this application may also include parameters such as real-time requirements, concurrent processing, and error handling, without limitation. Therefore, when arranging multiple event / field notifications of the same event group based on the call order of the subscription function, this application can comprehensively consider factors such as business logic, dependencies, priority, resource constraints, real-time requirements, concurrent processing, and error handling to ensure the stable operation and efficient processing of the system.
[0108] In step S130 of some embodiments, after determining the candidate state change data and the remaining initial state change data, this application can generate and send subscription messages on the client in units of event groups. That is, the subscription message based on the event group can carry which Event / Field Notify initiated the EventGroup subscription message.
[0109] It should be noted that the subscription message for event / field notifications is used to establish the subscription process. Only after the subscription process is successfully established will the data be sent from the server to the client. Furthermore, each event / field notification will generate a corresponding subscription message.
[0110] In some embodiments, please refer to Figure 5 , Figure 5 This is an optional flowchart of step S130 provided in the embodiments of this application. Step S130 may specifically include, but is not limited to, steps S510 to S520:
[0111] Step S510: Label the candidate state change data based on preset labels to obtain the target state change data;
[0112] Step S520: Generate the first subscription message based on the target state change data and the target event group.
[0113] In steps S510 and S520 of some embodiments, when generating the first subscription message corresponding to the candidate state change data, this application first marks the candidate state change data based on a preset tag to obtain the target state change data. The preset tag is used to let the server know that the state change data corresponding to the message is the last event / field notification called for subscription in the target event group. Further, this application generates messages for the target state change data based on the target event group to obtain the first subscription message.
[0114] In step S140 of some embodiments, for the remaining initial state change data in the target event group excluding candidate state change data, the client can generate a message for each candidate state change data on a target event group basis to obtain a corresponding second subscription message, and each candidate state change data will generate a corresponding second subscription message. Further, after generating each second subscription message, the client sends it to the server. However, after receiving a second subscription message that is not triggered by candidate state change data, the server does not send any response to the client until it receives the first subscription message, at which point it immediately sends a subscription success notification signal to the client.
[0115] In step S150 of some embodiments, when the client receives a subscription success notification signal from the server based on the first subscription message response, it sends an acknowledgment message to the server. Further, after receiving the acknowledgment message, the server begins to send the initial data values corresponding to each initial state change data to the client in a comprehensive manner, so that the client does not lose any initial values corresponding to any event / field notification in the target event group based on service discovery.
[0116] It should be noted that the server sends the initial data value corresponding to each initial state change data to the client in the form of a message. That is, the server can generate a business message based on the initial data value corresponding to each initial state change data, and the server can send the corresponding business messages to the client in the order of receiving the second subscription messages, so that the client can fully receive the initial value corresponding to each event / field notification in the target event group sent by the server.
[0117] Therefore, compared to related technologies that send all initial values after receiving a subscription message generated by an Event / Field Notify, this application can combine multiple Events / Notify in the target event group and mark specific Events / Notify (i.e., candidate state change data). The server only sends initial values to the client when it receives a subscription message triggered by a specific Event / Notify. This can reduce Ethernet bandwidth and operating system load while ensuring the integrity of communication data, and save as much development cost as possible when the SOMEIP protocol is implemented in a real vehicle.
[0118] In some embodiments, please refer to Figure 6 , Figure 6 This is another optional flowchart of the SOMEIP-based data processing method provided in this application embodiment. The SOMEIP-based data processing method applied to the server may include, but is not limited to, steps S610 to S620:
[0119] Step S610: Receive a candidate subscription message based on the target event group sent by the client;
[0120] Step S620: When the candidate subscription message is the first subscription message, send a subscription success notification signal to the client and send the initial data value corresponding to each initial state change data in the target event group to the client.
[0121] In steps S610 to S620 of some embodiments, the candidate subscription message includes a first subscription message and a second subscription message. The first subscription message indicates candidate state change data determined from multiple initial state change data of the target event group, and the second subscription message indicates the remaining initial state change data in the target event group. That is, the server can receive the first and second subscription messages based on the target event group sent by the client. When the candidate subscription message received by the server is the first subscription message, the server sends a subscription success notification signal to the client. Further, when the server receives an acknowledgment message from the client based on the subscription success notification signal, the server can send the initial data value corresponding to each initial state change data in the target event group to the client.
[0122] In some embodiments, please refer to Figure 7 , Figure 7 This is another optional flowchart of the SOMEIP-based data processing method provided in this application embodiment. Specifically, before step S620, the SOMEIP-based data processing method provided in this application may further include steps S710 to S730:
[0123] Step S710: Parse the candidate subscription messages to obtain parsed data;
[0124] Step S720: Perform tag detection on candidate subscription messages based on preset tags and parsed tags to obtain tag detection results;
[0125] Step S730: Based on the tag detection results, determine whether the candidate subscription message is the first subscription message or the second subscription message.
[0126] In steps S710 to S730 of some embodiments, after receiving each candidate subscription message, the server parses the message to obtain parsed data. The parsed data includes a parsed tag and the event / field notification from the target event group corresponding to the message. Further, the server can compare a preset tag and a parsed tag to perform tag detection on the candidate subscription message. The tag detection result indicates the matching status of the preset tag and the parsed tag, and the tag detection result includes both matching and non-matching. Further, the candidate subscription message can be determined as either a first subscription message or a second subscription message based on the tag detection result. When the tag detection result is a match, it means the preset tag and the parsed tag are the same, i.e., the corresponding candidate subscription message is a first subscription message; when the tag detection result is a non-match, it means the preset tag and the parsed tag are different, i.e., the corresponding candidate subscription message is a second subscription message.
[0127] It should be noted that for the first subscription message, the corresponding parsing tag is the preset tag. For the second subscription message, the corresponding parsing tag can be an empty tag or another default tag that is different from the preset tag.
[0128] For examples, please refer to Figure 8 , Figure 8This is a specific interactive flowchart of the SOMEIP-based data processing method provided in this application embodiment. First, the client constructs EventGroup1 (i.e., the target event group), which includes Event1, Event2, and Notify1. Notify1 is set as specific candidate state change data and is tagged with a preset label. Further, the client's Event1 calls a subscription function constructed based on preset subscription call parameters, sending an EventGroup1.Subscribe.Event1 message (i.e., the second subscription message corresponding to Event1) to the server. After parsing the received EventGroup1.Subscribe.Event1 message, the server finds that it is not a message tagged with the preset label and will not give any response to the client; that is, it is equivalent to sending an EventGroup1.NotResponse message (i.e., indicating that the server will not respond). Further, the client's Event2 calls a subscription function constructed based on preset subscription call parameters, sending an EventGroup1.Subscribe.Event2 message (i.e., the second subscription message corresponding to Event2) to the server. After parsing the received EventGroup1.Subscribe.Event2 message, the server finds that it is not a message marked with a preset tag and will not send any response to the client; this is equivalent to sending an EventGroup1.NotResponse message (indicating that the server will not respond). Further, the client's Notify1 call, based on the preset subscription call parameters, constructs a subscription function and sends an EventGroup1.Subscribe.Notify1 message (the first subscription message corresponding to Notify1) to the server. At this point, the server, after parsing the received EventGroup1.Subscribe.Notify1 message, finds that it is a message marked with a preset tag, indicating that the client has completed the subscription of all expected Events / Notify messages. The server then sends an EventGroup1.SubAck message to the client, indicating a successful subscription notification. Further, the server can send the initial data values corresponding to each initial state change data in the target event group to the client sequentially in the form of business messages.
[0129] Understandably, after the server receives EventGroup1.Subscribe.Event1, it sends the initial values corresponding to each initial state change in the target event group to the client sequentially via business messages. At this point, Event2 and Notify1 have not yet sent their subscription messages. If the server has already sent the initial values for Notify1 before Notify1 sends its corresponding subscription message, then when Notify1 sends the EventGroup1.Subscribe.Notify1 message to the server, it will not receive the initial values for Notify1, thus affecting Notify1's subsequent logical judgments.
[0130] This application provides a SOMEIP-based data processing method that clarifies how to design Event, Field Notify, and EventGroup in the SOMEIP protocol stack. It adds design logic for all Events and Field Notify under the same EventGroup, enabling the client to stably receive the initial values of all Events and Field Notify under that EventGroup. Specifically, by setting specific event / field notifications in the target event group, the server can determine whether all event / field notification messages in the target event group have been successfully subscribed. Once the server confirms successful subscription, it sends a subscription success signal and sends the initial data value corresponding to each initial state change data in the target event group to the client. Therefore, this application can completely receive the initial data values corresponding to all event / field notifications in the target event group, effectively reducing the packet loss rate of Events and solving the problem of initial value determination for Field Notify, thereby improving the communication efficiency between the server and the client.
[0131] Please see Figure 9 This application also provides a SOMEIP-based data processing apparatus for use on a client side, which can implement the aforementioned SOMEIP-based data processing method for use on a client side. The apparatus includes:
[0132] The acquisition module 910 is used to acquire the target event group corresponding to the communication service requirements in the target network communication; wherein, the target event group includes multiple initial state change data, and the initial state change data is used to indicate the event or field notification of the state change in the target network communication;
[0133] The determination module 920 is used to determine candidate state change data from multiple initial state change data based on preset subscription call parameters;
[0134] The first message generation module 930 is used to generate the first subscription message based on candidate state change data and target event group;
[0135] The second message generation module 940 is used to generate at least one second subscription message based on the remaining initial state change data and the target event group, and send the first subscription message and the second subscription message to the server.
[0136] The first receiving module 950 is used to receive the initial data value corresponding to each initial state change data sent by the server after receiving the subscription success notification signal from the server based on the first subscription message.
[0137] The specific implementation of this SOMEIP-based data processing device is basically the same as the specific implementation of the SOMEIP-based data processing method applied to the client described above, and will not be repeated here.
[0138] Please see Figure 10 This application also provides a SOMEIP-based data processing apparatus for use on a server, which can implement the aforementioned SOMEIP-based data processing method for use on a server. The apparatus includes:
[0139] The second receiving module 1010 is used to receive a candidate subscription message based on a target event group sent by a client; wherein the candidate subscription message includes a first subscription message and a second subscription message, the first subscription message is used to indicate candidate state change data determined from multiple initial state change data of the target event group, and the second subscription message is used to indicate the remaining initial state change data in the target event group.
[0140] The sending module 1020 is used to send a subscription success notification signal to the client when the candidate subscription message is the first subscription message, and to send the initial data value corresponding to each initial state change data in the target event group to the client.
[0141] The specific implementation of this SOMEIP-based data processing device is basically the same as the specific implementation of the SOMEIP-based data processing method applied to the server described above, and will not be repeated here.
[0142] This application also provides an electronic device, which includes at least one processor and at least one memory for storing at least one program. When the at least one program is executed by the at least one processor, the at least one processor implements the SOMEIP-based data processing method of this application. The electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0143] Please see Figure 11 , Figure 11The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0144] The processor 1110 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0145] The memory 1120 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1120 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1120 and is called and executed by the processor 1110 using the SOMEIP-based data processing method of the embodiments of this application.
[0146] The input / output interface 1130 is used to implement information input and output;
[0147] The communication interface 1140 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0148] Bus 1150 transmits information between various components of the device (e.g., processor 1110, memory 1120, input / output interface 1130, and communication interface 1140);
[0149] The processor 1110, memory 1120, input / output interface 1130 and communication interface 1140 are connected to each other within the device via bus 1150.
[0150] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described SOMEIP-based data processing method.
[0151] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0152] This application also provides a vehicle, which includes the aforementioned vehicle-mounted camera, vehicle-mounted equipment, or the aforementioned SOMEIP-based data processing device. The vehicle provided in this application can be a gasoline-powered vehicle or a new energy vehicle. When the vehicle is a new energy vehicle, it can be a hybrid vehicle or a pure electric vehicle.
[0153] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0154] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0155] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0156] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0157] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0158] It should be understood that in this application, "at least one" means one or more, "more" means two or more, "each" means each of the corresponding multiple, and "any" means any one of the multiple. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0159] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0160] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0161] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0162] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0163] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A data processing method based on SOMEIP, characterized in that, Applied to a client, wherein the client communicates with the server, the method includes: Obtain the target event group corresponding to the communication service requirements in the target network communication; wherein, the target event group includes multiple initial state change data, and the initial state change data is used to indicate the event or field notification of the state change in the target network communication; Candidate state change data are determined from multiple initial state change data based on preset subscription call parameters; A first subscription message is generated based on the candidate state change data and the target event group; Based on the remaining initial state change data and the target event group, at least one second subscription message is generated, and the first subscription message and the second subscription message are sent to the server. Upon receiving the subscription success notification signal from the server in response to the first subscription message, the system receives the initial data value corresponding to each of the initial state change data sent by the server.
2. The method according to claim 1, characterized in that, The step of generating a first subscription message based on the candidate state change data and the target event group includes: The candidate state change data is labeled with preset tags to obtain the target state change data. The first subscription message is generated based on the target state change data and the target event group.
3. The method according to claim 2, characterized in that, The step of determining candidate state change data from multiple initial state change data based on preset subscription call parameters includes: Based on preset subscription call parameters, multiple initial state change data are arranged to obtain a state change data list, which is used to indicate the order in which the multiple initial state change data call the preset subscription call parameters; The candidate state change data is determined based on the state change data list. The candidate state change data is used to characterize the initial state change data of the last caller of the preset subscription call parameters in the target event group.
4. The method according to claim 3, characterized in that, The preset subscription call parameters include business logic data, data dependencies, data priorities, and resource limit data corresponding to communication service requirements; the process of arranging multiple initial state change data based on the preset subscription call parameters to obtain a state change data list includes... Based on the business logic data, the initial state change data is scored to obtain a first score; Based on the data dependencies, the initial state change data is scored to obtain a second score; Based on the data priority, the initial state change data is scored to obtain a third score; Based on the resource constraint data, the initial state change data is scored to obtain a fourth score; The target score for the initial state change data is determined based on the first score, the second score, the third score, and the fourth score. Based on the target score, the multiple initial state change data are sorted in descending order to obtain the state change data list.
5. The method according to claim 1, characterized in that, The acquisition of the target event group corresponding to the communication service requirements in the target network communication includes: The communication service requirements in the target network communication are parsed to obtain service-related data and service scenario data. The service-related data is used to indicate event or field notifications related to the business logic of the communication service requirements, and the service scenario data is used to indicate event or field notifications related to the scenario corresponding to the communication service requirements. Based on the business-related data and business scenario data, multiple initial state change data are obtained from the preset state dataset, and the target event group is constructed based on the multiple initial state change data.
6. A data processing method based on SOMEIP, characterized in that, Applied to the server side, where the server communicates with the client, the method includes: Receive candidate subscription messages based on target event groups sent by the client; wherein, the candidate subscription message includes a first subscription message and a second subscription message, the first subscription message is used to indicate candidate state change data determined from multiple initial state change data of the target event group, and the second subscription message is used to indicate the remaining initial state change data in the target event group; When the candidate subscription message is the first subscription message, a subscription success notification signal is sent to the client, and the initial data value corresponding to each initial state change data in the target event group is sent to the client.
7. The method according to claim 6, characterized in that, Before sending a subscription success notification signal to the client when the candidate subscription message is the first subscription message, the method further includes: The candidate subscription message is parsed to obtain parsed data, which includes parsed tags; Tag detection is performed on the candidate subscription messages based on preset tags and the parsed tags to obtain tag detection results; Based on the tag detection results, the candidate subscription message is determined to be either the first subscription message or the second subscription message.
8. A data processing device based on SOMEIP, characterized in that, The device includes: The acquisition module is used to acquire target event groups corresponding to communication service requirements in the target network communication; wherein, the target event group includes multiple initial state change data, and the initial state change data is used to indicate events or field notifications that have undergone state changes in the target network communication; The determination module is used to determine candidate state change data from multiple initial state change data based on preset subscription call parameters; The first message generation module is used to generate a first subscription message based on the candidate state change data and the target event group; The second message generation module is used to generate at least one second subscription message based on the remaining initial state change data and the target event group, and send the first subscription message and the second subscription message to the server. The first receiving module is configured to receive the initial data value corresponding to each initial state change data sent by the server after receiving the subscription success notification signal from the server based on the first subscription message.
9. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method as described in any one of claims 1 to 5; Alternatively, the method as described in any one of claims 6 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 5; or, as described in any one of claims 6 to 7.
Citation Information
Patent Citations
Subscription service data transmission method and device, electronic equipment and storage medium
CN118055154A
Method and apparatus for mapping network events to names of network devices
US7181490B1