CN117917882A - Message processing method, device, equipment and computer readable storage medium - Google Patents

Message processing method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN117917882A
CN117917882A CN202211295080.9A CN202211295080A CN117917882A CN 117917882 A CN117917882 A CN 117917882A CN 202211295080 A CN202211295080 A CN 202211295080A CN 117917882 A CN117917882 A CN 117917882A
Authority
CN
China
Prior art keywords
message
processor
priority
receiving
steering table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211295080.9A
Other languages
Chinese (zh)
Inventor
刘迪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Rockwell Technology Co Ltd
Original Assignee
Beijing Rockwell Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Rockwell Technology Co Ltd filed Critical Beijing Rockwell Technology Co Ltd
Priority to CN202211295080.9A priority Critical patent/CN117917882A/en
Publication of CN117917882A publication Critical patent/CN117917882A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Embodiments of the present disclosure provide a method, apparatus, device, and computer readable storage medium for processing a message. The method comprises the following steps: receiving a message to be processed; selecting a message processor corresponding to the message to be processed from a plurality of processors according to the received packet steering table; determining a receiving application corresponding to the message to be processed from a plurality of applications according to the message attribute of the message to be processed; if the processor where the receiving application is located is inconsistent with the message processor, confirming the priority of the receiving application; comparing the priority with a preset priority; if the priority is greater than the preset priority, updating the receiving packet steering table, otherwise, not updating the receiving packet steering table. In this way, if it is confirmed that some receiving applications have low priorities, the receiving packet steering table is not updated by the receiving applications having low priorities, which reduces the frequency of modification of the receiving packet steering table, and naturally reduces the number of entries in the receiving packet steering table that need to be modified, which improves the message processing performance.

Description

Message processing method, device, equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of information processing, and in particular, to the field of message processing technology.
Background
Currently, in order to increase the processing power of devices, many devices are configured with multiple processors (CPUs, central processing unit), and different applications on such devices may run on different processors to achieve load balancing. At this time, after receiving the message sent by other devices, in order to implement efficient processing of the message, a sending processor corresponding to the message is selected first, and the sending processor is used as a message processor, so as to buffer the message by using the message processor, and further determine a receiving application corresponding to the message, so that the receiving application can acquire the message by means of the message processor, and the device with multiple processors can quickly transmit and process the message.
However, in practice, for various reasons, the selected message processor and the processor where the receiving Application is located may not be the same processor, and at this time, the processor where the receiving Application is located needs to buffer the message once again, so that the receiving Application can obtain the message, and the buffer times of the message are increased, which greatly affects the cache of the device, and affects the packet receiving performance, so that in order to improve the packet receiving performance, it is required to update the receiving packet steering table (such as the SOCK_RPS table item shown in FIG. 1, where RPS is RECEIVE PACKET STEERING, SOCK, i.e. Socket, socket), and update the message processor corresponding to the message in the receiving packet steering table to the processor where the receiving Application (APP, application) is located, as shown in FIG. 1, so as to ensure that the selected processor and the processor where the Application are located are the same as possible after receiving the similar message again, thereby fully utilizing the cache of the device to achieve the best optimization effect.
Thus, there are the following problems:
1. If the same message is concerned by different applications and the different applications run on different processors, frequent modification of the received packet steering table is required, as shown in fig. 2, and if APP1 (application 1) and APP2 (application 2) are both concerned with the message and APP1 and APP2 find that the processor where they are located is inconsistent with the message processor selected by the table entry, then the received packet steering table needs to be modified for 2 times, and at this time, the message processing performance will not be improved or even deteriorated.
2. When the application is particularly numerous, the entries in the received packet steering table that need to be modified will be numerous and will also affect the message processing performance.
Disclosure of Invention
The disclosure provides a message processing method, a message processing device, a message processing storage medium and a vehicle.
According to a first aspect of the present disclosure, a message processing method is provided. The method comprises the following steps:
receiving a message to be processed, wherein the message comprises a message attribute;
selecting a message processor corresponding to the message to be processed from a plurality of processors according to a received packet steering table;
reading the message attribute from the message to be processed;
Determining a receiving application corresponding to the message to be processed from a plurality of applications according to the message attribute of the message to be processed;
If the processor where the receiving application is located is inconsistent with the message processor, confirming the priority of the receiving application;
Comparing the priority with a preset priority;
If the priority is greater than the preset priority, updating the receiving packet steering table, otherwise, not updating the receiving packet steering table, wherein the receiving packet steering table stores the corresponding relation between the message and the processor and is used for selecting the message processor.
In the aspects and any possible implementation manner of the foregoing, there is further provided an implementation manner, after selecting a message processor corresponding to the message to be processed, the method further includes:
Adding an identifier of the message processor in the message to be processed; and
Determining, by the receiving application, an identity of a processor in which it is located;
If the processor where the receiving application is located is inconsistent with the message processor, confirming the priority of the receiving application, including:
and if the identification of the processor where the receiving application is located is inconsistent with the identification of the message processor added in the message to be processed, confirming the priority of the receiving application.
Aspects and any one of the possible implementations as described above, further provide an implementation, where the preset priority includes: an application priority threshold or the priority of the application which receives the message with the same type as the message to be processed last time;
and if the priority is greater than the preset priority, updating the received packet steering table, including:
if the priority is greater than the application priority threshold, updating the received packet steering table;
Or alternatively
And if the priority is greater than the priority of the application which receives the message with the same type as the message to be processed last time, updating the received packet steering table.
Aspects and any one of the possible implementations as described above, further provide an implementation, where the preset priority includes: an application priority threshold and the priority of the application which receives the message with the same type as the message to be processed last time;
And if the priority of the receiving application is greater than the preset priority, updating a receiving packet steering table, including:
If the priority of the receiving application is greater than the application priority threshold, comparing the priority of the receiving application with the priority of the application which receives the message with the same type as the message to be processed last time;
And if the priority of the receiving application is greater than the priority of the application which receives the message with the same type as the message to be processed last time, updating the receiving packet steering table.
Aspects and any one of the possible implementations as set forth above, further provide an implementation, the updating the received packet steering table includes:
and updating the message processor corresponding to the message to be processed, which is recorded in the received packet steering table, into a processor where the receiving application is located.
In aspects and any one of the possible implementations described above, there is further provided an implementation, the received packet steering table includes a first received packet steering table and a second received packet steering table, wherein,
The query level of the first received packet steering table is higher than the query level of the second received packet steering table;
The updating the message processor corresponding to the message to be processed recorded in the received packet steering table to the processor where the receiving application is located includes:
updating the message processor corresponding to the message to be processed recorded in the first receiving packet steering table to be the processor where the receiving application is located, wherein the corresponding relation between the message stored in the second receiving packet steering table and the processor is different from the corresponding relation between the message stored in the first receiving packet steering table and the processor.
The aspect and any possible implementation manner as described above further provide an implementation manner, where the selecting, according to a received packet steering table, a packet processor corresponding to the to-be-processed packet from multiple processors includes:
Selecting the message processor from the plurality of processors according to the first received packet steering table and the message to be processed;
if the message processor is not queried from the first receiving packet steering table, selecting the message processor from the plurality of processors according to the second receiving packet steering table and the message to be processed;
And if the message processor is not queried from the second received packet steering table, randomly selecting the message processor from the plurality of processors.
In the aspect and any possible implementation manner described above, there is further provided an implementation manner, where the determining, according to a message attribute of the to-be-processed message, a receiving application of the to-be-processed message from a plurality of applications includes:
Acquiring pre-recorded message attributes corresponding to the applications;
And selecting the receiving application from the plurality of applications according to the message attribute and the message attribute corresponding to each of the plurality of applications.
According to a second aspect of the present disclosure, a message processing apparatus is provided. The device comprises:
the receiving module is used for receiving a message to be processed, wherein the message comprises message attributes;
The selection module is used for selecting a message processor corresponding to the message to be processed from a plurality of processors according to a received packet steering table;
The reading module is used for reading the message attribute from the message to be processed;
The first determining module is used for determining a receiving application corresponding to the message to be processed from a plurality of applications according to the message attribute of the message to be processed;
The second determining module is used for determining the priority of the receiving application if the processor where the receiving application is located is inconsistent with the message processor;
The comparison module is used for comparing the priority with a preset priority;
And the updating module is used for updating the receiving packet steering table if the priority is greater than the preset priority, otherwise, not updating the receiving packet steering table, wherein the receiving packet steering table stores the corresponding relation between the message and the processor and is used for selecting the message processor.
According to a third aspect of the present disclosure, an electronic device is provided. The electronic device includes: a memory and a processor, the memory having stored thereon a computer program, the processor implementing the method as described above when executing the program.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a method according to the first and/or second aspects of the present disclosure.
According to a fifth aspect of the present disclosure, there is provided a vehicle comprising a message processing apparatus as described in the second aspect and/or an electronic device as described in the third aspect.
In the disclosure, after receiving a message to be processed, a message processor may be selected from a plurality of processors according to a receiving packet steering table, then the message attribute is read from the message to be processed, further, according to the message attribute of the message to be processed, a receiving application corresponding to the message to be processed is determined from a plurality of applications, further, whether the processor where the receiving application is located is consistent with the message processor is confirmed, if not, the priority of the receiving application is confirmed, then the priority is compared with a preset priority, if the priority of the receiving application is greater than the preset priority, the receiving packet steering table is updated, otherwise, the receiving packet steering table is not updated, if confirming that some receiving application priorities are low, the receiving packet steering table is not updated due to the receiving application with low priority, and only the receiving packet steering table is updated due to the receiving application with high priority, so that the modifying frequency of the receiving packet steering table is reduced, and the number of items required to be modified in the receiving packet steering table is naturally reduced, so that the message processing performance is improved.
It should be understood that what is described in this summary is not intended to limit the critical or essential features of the embodiments of the disclosure nor to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other features, advantages and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. For a better understanding of the present disclosure, and without limiting the disclosure thereto, the same or similar reference numerals denote the same or similar elements, wherein:
FIG. 1 is a flow chart of a message processing method in the prior art;
FIG. 2 is a flow chart of another message processing method in the prior art;
FIG. 3 illustrates a flow chart of a message processing method according to an embodiment of the present disclosure;
FIG. 4 illustrates a flow chart of another message processing method according to an embodiment of the present disclosure;
FIG. 5 illustrates a flow chart of yet another message processing method according to an embodiment of the present disclosure;
FIG. 6 illustrates a flow chart of yet another message processing method according to an embodiment of the present disclosure;
FIG. 7 illustrates a flow chart of yet another message processing method according to an embodiment of the present disclosure;
FIG. 8 shows a block diagram of a message processing apparatus according to an embodiment of the disclosure;
Fig. 9 illustrates a block diagram of an exemplary electronic device capable of implementing embodiments of the present disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are some embodiments of the present disclosure, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments in this disclosure without inventive faculty, are intended to be within the scope of this disclosure.
In addition, the term "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
Fig. 3 illustrates a flow chart of a message processing method 300 according to an embodiment of the disclosure. The method 300 is applicable to an operating system of various terminals such as vehicles having a plurality of processors, and may include:
step 310, receiving a message to be processed, wherein the message comprises a message attribute;
the message to be processed may come from other devices.
Step 320, selecting a message processor corresponding to the message to be processed from a plurality of processors according to a received packet steering table;
The receiving packet steering table is a table, and specific forms include, but are not limited to, EXCEL and the like, and the corresponding relation between the packet and the processor recorded in the receiving packet steering table is used for selecting a packet processor, specifically, the corresponding relation between the type of the packet and the identifier of the processor can be recorded in the receiving packet steering table, so that the corresponding packet processor can be determined after the receiving packet steering table is queried according to the type of the to-be-processed packet, wherein the type of the packet includes, but is not limited to, a packet attribute or a hash value calculated based on the packet attribute.
For example: the received packet forwarding table may store a correspondence between a hash value (hash) of the packet and an identifier (such as a number, a model, a name, or a combination thereof) of the processor, where the calculation of the hash value may be calculated by a quadruple (source IP, source port number, destination IP, destination port number), where IP is Internet Protocol Address is an internet protocol address.
Preferably, if there is a received packet forwarding table and the type of the message to be processed can be queried from the received packet forwarding table, it is determined which processor should be used as a message processor to process (buffer, forward) the message to be processed according to the received packet forwarding table and the type of the message to be processed.
If there is no received packet steering table or there is a received packet steering table but the type of the message to be processed cannot be queried from the received packet steering table, a certain processor is randomly selected from a plurality of processors as a message processor to process (buffer and forward) the message to be processed, and then the received packet steering table is created or updated according to the identification of the randomly selected processor and the type of the message to be processed.
Step 330, reading the message attribute from the message to be processed;
Step 340, determining a receiving application corresponding to the message to be processed from a plurality of applications according to the message attribute of the message to be processed;
Step 350, if the processor where the receiving application is located is inconsistent with the message processor, confirming the priority of the receiving application;
A receiving application refers to an application that is ultimately to receive and respond to a message,
On which processor the receiving application is running, the processor being the processor on which the receiving application is located.
The processor where the receiving application is located is inconsistent with the message processor means that the processor where the receiving application is located is not the same processor as the message processor.
Step 360, comparing the priority with a preset priority;
The priority of each application is preset, and can be determined by the receiving application according to the importance degree of the service processed by each application and fed back to the operating system; in addition, the priority of each application may be stored in any file in the priority table. For example: the priority levels of (1) can be classified into 5 priorities of L1, L2, L3, L4, and L5, wherein the priorities of L1, L2, L3, L4, and L5 are sequentially increased.
The preset priority includes: an application priority threshold or the priority of the application which receives the message with the same type as the message to be processed last time;
The application priority threshold is a global priority, and does not change due to a change in the priority of an application, and if used, the application priority must be greater than the application priority threshold in order to update the received packet steering table according to the priority of an application.
The application priority threshold may be based on the priority of each application, and may be averaged, e.g., the application priority threshold may be L3.
The priority of the application that receives the message with the same type as the message to be processed, that is, the priority of the application that receives the message with the same type last time, where the type of the message to be processed may depend on the message attribute (the message attribute includes but is not limited to IP address port number, protocol type, service type of the message, etc.), or since the message attribute can determine that the application is received, it is already very detailed, and thus, may depend on some attributes in the message attribute (such as four elements of source IP, source port number, destination IP, destination port number, or three elements of source IP, source port number, destination IP).
And 370, if the priority is greater than the preset priority, updating a received packet steering table, otherwise, not updating the received packet steering table, wherein the received packet steering table stores a correspondence between messages and processors and is used for selecting the message processor.
After receiving a message to be processed, a message processor can be selected from a plurality of processors according to a received packet steering table, then the message attribute is read from the message to be processed, further, according to the message attribute of the message to be processed, a receiving application corresponding to the message to be processed is determined from a plurality of applications, further, whether the processor where the receiving application is located is consistent with the message processor is confirmed, if not, the priority of the receiving application is confirmed, then the priority of the application is compared with the preset priority, if the priority of the receiving application is greater than the preset priority, the received packet steering table is updated, otherwise, the received packet steering table is not updated, if the priority of some receiving applications is confirmed to be low, the received packet steering table is not updated due to the receiving application with low priority, and only the received packet steering table is updated due to the receiving application with high priority, so that the modifying frequency of the received packet steering table is reduced, and the number of the tables needing to be modified in the received packet steering table is naturally reduced, so that the message processing performance is improved.
The received packet steering table stores exactly the correspondence between the hash value (hash) of the packet and the identity of the processor, and the calculation of this hash value can be calculated by a quadruple (source IP, source port number, destination IP, destination port number), where IP is Internet Protocol Address, which is an internet protocol address.
After updating the receiving packet steering table, as long as the received new message is the same as the quadruple of the to-be-processed message, the new message is considered to be a similar (same type) message of the to-be-processed message, and the receiving packet steering table can be utilized to correctly confirm the message processor corresponding to the message, so that the message processor is ensured to be identical with the processor of the receiving application corresponding to the new message as far as possible, secondary buffering of the message is avoided, high-speed buffering of equipment is fully utilized, and the message processing efficiency is improved. .
In some embodiments, after selecting a message processor corresponding to the message to be processed, the method further includes:
adding an identifier of the message processor in the message to be processed; the identification includes, but is not limited to, a name, a label, etc.
Determining, by the receiving application, an identity of a processor in which it is located;
Because each application will take various data from its processor, each application can determine exactly which processor it is on during the process of reading the data.
If the processor where the receiving application is located is inconsistent with the message processor, confirming the priority of the receiving application, including:
and if the identification of the processor where the receiving application is located is inconsistent with the identification of the message processor added in the message to be processed, confirming the priority of the receiving application.
After confirming the message processor, the identification of the message processor can be added to the message to be processed, the message processor is utilized to buffer the message, meanwhile, the receiving application is informed to read the message from the buffer memory of the processor where the receiving application is located, after receiving the notification, the receiving application can confirm whether the identification of the processor where the receiving application is located is consistent with the identification of the message processor added to the message to be processed or not from the read message, if not, the priority of the receiving application needs to be confirmed, and whether the receiving packet steering table is updated or not is conveniently judged by utilizing priority comparison.
Of course, if they are inconsistent, it means that the processor where the receiving application is located reads the message from the buffer of the message processor once again and buffers the message once again.
In some embodiments, the preset priority comprises: an application priority threshold or the priority of the application which receives the message with the same type as the message to be processed last time;
And if the priority is greater than the preset priority, updating a received packet steering table, including:
if the priority is greater than the application priority threshold, updating the received packet steering table; or alternatively
And if the priority is greater than the priority of the application which receives the message with the same type as the message to be processed last time, updating the received packet steering table.
The application priority threshold is a global priority, and does not change due to a change in the priority of an application, and if used, the application priority must be greater than the application priority threshold in order to update the received packet steering table according to the priority of an application.
The application priority threshold may be based on the priority of each application, and may be averaged, e.g., the application priority threshold may be L3.
And the priority of the application which receives the message with the same type as the message to be processed last time, namely the priority of the application which receives the message with the same type last time, wherein the type of the message to be processed can be determined according to the message attribute or part of the attribute in the message attribute.
Specifically, the priority of the application that receives the message with the same type as the message to be processed last time refers to the priority of the application that processes the message when the message with the same type is received last time. If the priority of the receiving application is greater than the application priority threshold or the priority of the receiving application is greater than the priority of the application which receives the message of the same type as the message to be processed last time, the priority of the receiving application is high, so that the receiving packet steering table can be updated according to the receiving application, the receiving packet steering table is prevented from being modified due to the application with low priority, the modification frequency of the receiving packet steering table is reduced, the number of items to be modified in the receiving packet steering table is naturally reduced, and the message processing performance is improved.
In some embodiments, the preset priority comprises: an application priority threshold and the priority of the application which receives the message with the same type as the message to be processed last time;
And if the priority is greater than the preset priority, updating a received packet steering table, including:
If the priority is greater than the application priority threshold, comparing the priority with the priority of the application which receives the message with the same type as the message to be processed last time;
And if the priority is greater than the priority of the application which receives the message with the same type as the message to be processed last time, updating a receiving packet steering table.
If the priority of the receiving application is greater than the application priority threshold, the priority of the receiving application can be further compared with the priority of the application which receives the message with the same type as the message to be processed last time, if the priority of the receiving application is greater than the priority of the application which receives the message with the same type as the message to be processed last time, the priority of the receiving application can be fully described as being very high, so that the receiving packet steering table can be updated according to the receiving application, the receiving packet steering table is prevented from being modified due to the application with low priority, the modification frequency of the receiving packet steering table is reduced, the number of table items to be modified in the receiving packet steering table is naturally reduced, and the message processing performance is improved.
In some embodiments, the updating the received packet steering table includes:
And updating the message processor corresponding to the message to be processed, which is recorded in the received packet steering table, into a processor where the receiving application is located. The identification of the message processor corresponding to the type of the message to be processed recorded in the received packet steering table is updated to the identification of the processor where the receiving application is located, so that the processor where the receiving application is located can be used as the message processor when the message of the same type is received next time, and the buffer hit rate of the processor is improved.
The process of updating the receiving packet steering table is to update the message processor corresponding to the message to be processed recorded in the receiving packet steering table to the processor where the receiving application is located, so that the message processor corresponding to the message to be processed recorded in the receiving packet steering table can be updated due to the application with high priority, and correct message processor can be selected after receiving the similar (same type) message again, thereby improving the buffer hit rate of the processor, and further improving the message processing efficiency and the message processing performance.
Of course, if the message processor corresponding to the message to be processed is not recorded in the received packet steering table, determining the processor where the receiving application is located as the message processor corresponding to the message to be processed, and recording the determined message processor in the received packet steering table.
In some embodiments, the received packet steering table comprises a first received packet steering table and a second received packet steering table, wherein a query level of the first received packet steering table is higher than a query level of the second received packet steering table;
The query level refers to a query priority order, the query level of the first received packet steering table is higher than the query level of the second received packet steering table, the first received packet steering table is queried preferentially, and after which processor is not used as a message processor in the first received packet steering table, the second received packet steering table is queried again.
The updating the message processor corresponding to the message to be processed recorded in the received packet steering table to the processor where the receiving application is located includes:
Updating the message processor corresponding to the message to be processed recorded in the first receiving packet steering table to be the processor where the receiving application is located, wherein the corresponding relation between the message stored in the second receiving packet steering table and the processor is different from the corresponding relation between the message stored in the first receiving packet steering table and the processor, and the second receiving packet steering table cannot be updated according to the priority.
The first received packet steering table is queried at a higher level than the second received packet steering table, and thus the first received packet steering table is updated when the received packet steering table is updated.
The first receiving packet steering table is a SOCK_RPS table item, wherein SOCK is Socket and Socket;
The second received packet steering table is an RPS table entry;
The corresponding relation between the second receiving packet steering table and the processor is preset, and is automatically generated according to some principles, for example, the corresponding relation between the second receiving packet steering table and the processor is different from the corresponding relation between the first receiving packet steering table and the processor, specifically, when a certain type of message is received for the first time, the processor required by processing the type of message is generated, and after the same type of message is received again, if the processor corresponding to the type of message is updated, the processor corresponding to the first receiving packet steering table is required to be updated, and the second receiving packet steering table is not updated, so that the corresponding relation between the second receiving packet steering table and the message stored in the first receiving packet steering table is different from the corresponding relation between the first receiving packet steering table and the processor, and the corresponding relation between the second receiving packet steering table and the processor is generated when the number of the second receiving packet steering table is different from the first receiving packet steering table is higher than the first receiving packet steering table, the corresponding relation between the number of the second receiving packet steering table and the first receiving packet is higher than the first receiving packet steering table is generated, and the corresponding relation between the second receiving packet steering table and the first receiving packet is deleted.
In addition, the priority of the application that receives the message of the same type as the message to be processed last time may be recorded in the first received packet steering table, or other positions, but is not suitable for recording in the second received packet steering table, because the query level of the second received packet steering table is low, and is not suitable for recording.
The corresponding relation between the message and the processor recorded in the first receiving packet steering table is the corresponding relation which is modified according to the processor where the receiving application is located when the processor where the receiving application is located is inconsistent with the message processor, and the accuracy is high, and the selected processor and the processor where the receiving application is located can be ensured to be identical, so that the query level of the first receiving packet steering table is higher than the query level of the second receiving packet steering table.
In some embodiments, the selecting, from a plurality of processors according to a received packet steering table, a message processor corresponding to the message to be processed includes:
Selecting the message processor from the plurality of processors according to the first received packet steering table and the message to be processed;
When selecting, the message processor corresponding to the type of the message to be processed can be automatically selected from a plurality of processors according to the type of the message to be processed, the type of the message recorded in the first receiving packet steering table and the identification of the processor.
If the message processor is not queried from the first receiving packet steering table, selecting the message processor from the plurality of processors according to the second receiving packet steering table and the message to be processed;
The principle of selecting the message processor in the second received packet steering table is the same as that described above, and will not be repeated here.
And if the message processor is not queried from the second received packet steering table, randomly selecting the message processor from the plurality of processors.
Because the priority of the first receiving packet steering table is higher than that of the second receiving packet steering table, that is, the processor corresponding to the message recorded in the first receiving packet steering table is more accurate than the processor corresponding to the message recorded in the second receiving packet steering table, the message processor can be selected from the plurality of processors preferentially according to the first receiving packet steering table and the message to be processed, then if the message processor is not queried from the first receiving packet steering table, the message processor is selected from the plurality of processors according to the second receiving packet steering table and the message to be processed, and if the message processor is not queried in the second receiving packet steering table, the message processor can be selected from the plurality of processors randomly.
Of course, if the first receiving packet steering table and the second receiving packet steering table exist, only the processor corresponding to the message to be processed is not found from the first receiving packet steering table and the second receiving packet steering table, and when a certain processor is randomly selected as the message processor, the first receiving packet steering table needs to be updated according to the randomly selected message processor and the message to be processed;
It should be noted that, there is a very special case, if there is no first receiving packet steering table and no second receiving packet steering table, after receiving the message to be processed, it is also necessary to randomly select a message processor from a plurality of processors, and then create the second receiving packet steering table according to the randomly selected message processor and the message to be processed, which is not the focus of the present disclosure.
In some embodiments, the determining, according to the message attribute of the to-be-processed message, the receiving application of the to-be-processed message from multiple applications includes:
acquiring message attributes corresponding to a plurality of pre-recorded applications respectively;
Message attributes of the message to be received include, but are not limited to, IP address, port number, protocol type, service type, etc. of the message to be processed.
The message attributes corresponding to the applications respectively, namely the attributes of the messages concerned by the applications respectively, wherein the message attributes include but are not limited to: IP address, port number, protocol type, traffic type of the message, etc.
And selecting the receiving application from the plurality of applications according to the message attribute and the message attribute corresponding to each of the plurality of applications.
By automatically matching the message attribute with the message attribute corresponding to each of the plurality of pre-recorded applications, the receiving application can be automatically selected from the plurality of applications, so that the accuracy of selecting the receiving application is improved.
The technical solution of the present disclosure will be described in further detail below with reference to fig. 4 and 5:
As shown in fig. 4, the network card selects the CPU by querying the sock_rps table entry, if no sock_rps table entry continues to query the RPS table entry, no RPS table entry is selected from the multiple CPUs at random for uploading, the uploading CPU caches the message, then puts the message into the APP message queue, and at the same time, the operating system confirms the received APP corresponding to the message (assuming that the received APP includes APP1 and APP 2), and notifies the received APP, and of course, no table entry exists in the initialized state.
Receiving an APP notification, receiving a message, confirming whether the CPU is consistent with the CPU where the APP is located according to the identification of the uploading CPU carried in the message, if the CPU is inconsistent with the CPU, comparing the priority of the APP with an application priority threshold (shown in figure 5) by the APP1 and the APP2 in the received APP, and if the priority of the APP1 is higher than the application priority threshold and the priority of the APP2 is lower than the application priority threshold, feeding back to an operating system by the APP1 to update the selected CPU corresponding to the message in the SOCK_RPS table item to the priority where the APP1 is located, and if the priority of the APP2 is low, not feeding back by the APP2, so that the SOCK_RPS table item is not updated by the APP 2.
The flow of fig. 6 and 7 is similar to that of fig. 4 and 5, except that the priority comparison process compares the application priority with the application priority threshold, and also compares the application priority with the priority of the application that received the same message as the message to be processed last time, so as to ensure that only the application with a sufficiently high priority affects the dock_rps table entry and avoid too frequent modification of the dock_rps table entry to affect the message processing performance.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present disclosure is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present disclosure. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all alternative embodiments, and that the acts and modules referred to are not necessarily required by the present disclosure.
The foregoing is a description of embodiments of the method, and the following further describes embodiments of the present disclosure through examples of apparatus.
Fig. 8 shows a block diagram of a message processing apparatus 800 according to an embodiment of the disclosure. As shown in fig. 8, the apparatus 800 includes:
a receiving module 810, configured to receive a message to be processed, where the message includes a message attribute;
A selecting module 820, configured to select a message processor corresponding to the message to be processed from multiple processors according to a received packet steering table;
A reading module 830, configured to read the message attribute from the message to be processed;
A first determining module 840, configured to determine, according to the message attribute of the message to be processed, a receiving application corresponding to the message to be processed from a plurality of applications;
a second determining module 850, configured to confirm the priority of the receiving application if the processor where the receiving application is located is inconsistent with the message processor;
A comparing module 860, configured to compare the priority with a preset priority;
And the updating module 870 is configured to update the received packet steering table if the priority is greater than the preset priority, and otherwise, not update the received packet steering table, where the received packet steering table stores a correspondence between a packet and a processor, and is used to select the packet processor.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the described modules may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again.
According to an embodiment of the present disclosure, the present disclosure further provides an electronic device, including:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the method embodiments described above.
According to an embodiment of the present disclosure, there is also provided a vehicle including: the message processing apparatus according to the above embodiment or the electronic device according to the above embodiment.
According to an embodiment of the present disclosure, there is also provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform any one of the method embodiments described above.
Fig. 9 shows a schematic block diagram of an electronic device 900 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
The apparatus 900 includes a computing unit 901 which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 902 or a computer program loaded from a storage unit 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other by a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
Various components in device 900 are connected to I/O interface 905, including: an input unit 906 such as a keyboard, a mouse, or the like; an output unit 907 such as various types of displays, speakers, and the like; a storage unit 908 such as a magnetic disk, an optical disk, or the like; and a communication unit 909 such as a network card, modem, wireless communication transceiver, or the like. The communication unit 909 allows the device 900 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunications networks.
The computing unit 901 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 901 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as method 300. For example, in some embodiments, the method 300 may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 900 via the ROM 902 and/or the communication unit 909. When the computer program is loaded into RAM 903 and executed by computing unit 901, one or more steps of method 300 described above may be performed. Alternatively, in other embodiments, computing unit 901 may be configured to perform method 300 by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (12)

1. A method for processing a message, comprising:
receiving a message to be processed, wherein the message comprises a message attribute;
selecting a message processor corresponding to the message to be processed from a plurality of processors according to a received packet steering table;
reading the message attribute from the message to be processed;
Determining a receiving application corresponding to the message to be processed from a plurality of applications according to the message attribute of the message to be processed;
If the processor where the receiving application is located is inconsistent with the message processor, confirming the priority of the receiving application;
Comparing the priority with a preset priority;
If the priority is greater than the preset priority, updating the receiving packet steering table, otherwise, not updating the receiving packet steering table, wherein the receiving packet steering table stores the corresponding relation between the message and the processor and is used for selecting the message processor.
2. The method according to claim 1, wherein after selecting a message processor corresponding to the message to be processed, the method further comprises:
Adding an identifier of the message processor in the message to be processed; and
Determining, by the receiving application, an identity of a processor in which it is located;
If the processor where the receiving application is located is inconsistent with the message processor, confirming the priority of the receiving application, including:
and if the identification of the processor where the receiving application is located is inconsistent with the identification of the message processor added in the message to be processed, confirming the priority of the receiving application.
3. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The preset priority includes: an application priority threshold or the priority of the application which receives the message with the same type as the message to be processed last time;
and if the priority is greater than the preset priority, updating the received packet steering table, including:
if the priority is greater than the application priority threshold, updating the received packet steering table;
Or alternatively
And if the priority is greater than the priority of the application which receives the message with the same type as the message to be processed last time, updating the received packet steering table.
4. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The preset priority includes: an application priority threshold and the priority of the application which receives the message with the same type as the message to be processed last time;
And if the priority is greater than the preset priority, updating a received packet steering table, including:
If the priority is greater than the application priority threshold, comparing the priority with the priority of the application which receives the message with the same type as the message to be processed last time;
And if the priority of the receiving application is greater than the priority of the application which receives the message with the same type as the message to be processed last time, updating the receiving packet steering table.
5. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The updating the received packet steering table includes:
and updating the message processor corresponding to the message to be processed, which is recorded in the received packet steering table, into a processor where the receiving application is located.
6. The method of claim 5, wherein the step of determining the position of the probe is performed,
The received packet steering table includes a first received packet steering table and a second received packet steering table, wherein,
The query level of the first received packet steering table is higher than the query level of the second received packet steering table;
The updating the message processor corresponding to the message to be processed recorded in the received packet steering table to the processor where the receiving application is located includes:
updating the message processor corresponding to the message to be processed recorded in the first receiving packet steering table to be the processor where the receiving application is located, wherein the corresponding relation between the message stored in the second receiving packet steering table and the processor is different from the corresponding relation between the message stored in the first receiving packet steering table and the processor.
7. The method of claim 6, wherein the step of providing the first layer comprises,
The selecting a message processor corresponding to the message to be processed from a plurality of processors according to a received packet steering table comprises:
Selecting the message processor from the plurality of processors according to the first received packet steering table and the message to be processed;
if the message processor is not queried from the first receiving packet steering table, selecting the message processor from the plurality of processors according to the second receiving packet steering table and the message to be processed;
And if the message processor is not queried from the second received packet steering table, randomly selecting the message processor from the plurality of processors.
8. The method according to any one of claims 1 to 7, wherein,
The determining, according to the message attribute of the message to be processed, a receiving application of the message to be processed from a plurality of applications includes:
Acquiring pre-recorded message attributes corresponding to the applications;
And selecting the receiving application from the plurality of applications according to the message attribute and the message attribute corresponding to each of the plurality of applications.
9. A message processing apparatus, comprising:
the receiving module is used for receiving a message to be processed, wherein the message comprises message attributes;
The selection module is used for selecting a message processor corresponding to the message to be processed from a plurality of processors according to a received packet steering table;
The reading module is used for reading the message attribute from the message to be processed;
The first determining module is used for determining a receiving application corresponding to the message to be processed from a plurality of applications according to the message attribute of the message to be processed;
The second determining module is used for determining the priority of the receiving application if the processor where the receiving application is located is inconsistent with the message processor;
The comparison module is used for comparing the priority with a preset priority;
And the updating module is used for updating the receiving packet steering table if the priority is greater than the preset priority, otherwise, not updating the receiving packet steering table, wherein the receiving packet steering table stores the corresponding relation between the message and the processor and is used for selecting the message processor.
10. An electronic device, comprising:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
11. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-8.
12. A vehicle, characterized by comprising: the message processing apparatus according to claim 9, and/or the electronic device according to claim 10, and/or the readable storage medium according to claim 11.
CN202211295080.9A 2022-10-21 2022-10-21 Message processing method, device, equipment and computer readable storage medium Pending CN117917882A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211295080.9A CN117917882A (en) 2022-10-21 2022-10-21 Message processing method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211295080.9A CN117917882A (en) 2022-10-21 2022-10-21 Message processing method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN117917882A true CN117917882A (en) 2024-04-23

Family

ID=90729756

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211295080.9A Pending CN117917882A (en) 2022-10-21 2022-10-21 Message processing method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117917882A (en)

Similar Documents

Publication Publication Date Title
WO2019100921A1 (en) Information pushing method and device
US9742855B2 (en) Hybrid tag matching
CN113656176A (en) Cloud equipment distribution method, device, system, electronic equipment, medium and product
CN113010535B (en) Cache data updating method, device, equipment and storage medium
CN115484233B (en) Method, device, equipment and medium for forwarding link aggregation message in digital communication chip
CN117917882A (en) Message processing method, device, equipment and computer readable storage medium
CN114143196B (en) Instance configuration updating method, device, equipment, storage medium and program product
CN113541987A (en) Method and device for updating configuration data
CN115617859A (en) Data query method and device based on knowledge graph cluster
CN116243978A (en) Data protocol method, device, medium and training system in distributed training
CN114338529B (en) Five-tuple rule matching method and device
CN113986135B (en) Method, device, equipment and storage medium for processing request
CN109831385B (en) Message processing method and device and electronic equipment
CN113726885A (en) Method and device for adjusting flow quota
CN110019671B (en) Method and system for processing real-time message
CN114615273B (en) Data transmission method, device and equipment based on load balancing system
CN114449031B (en) Information acquisition method, device, equipment and storage medium
CN113032402B (en) Method, device, equipment and storage medium for storing data and acquiring data
CN117560368B (en) File transmission method and system based on multistage node network
CN115242733B (en) Message multicast method, multicast gateway, electronic device and storage medium
CN115086300B (en) Video file scheduling method and device
CN112699115A (en) Data storage and query method and device, electronic equipment and storage medium
CN115037802B (en) Request processing method and device, electronic equipment and storage medium
CN111405051B (en) Processing method, device and equipment of Application Programming Interface (API) information
CN118118386A (en) Link delay detection method, device, equipment and storage medium

Legal Events

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