Rtos data processing method based on network protocol stack fusion and related equipment
By integrating multiple network protocol stacks into an RTOS and customizing their usage ratios and adaptation strategies, the problem of insufficient flexibility in using RTOS network protocol stacks is solved, and network communication optimization and adaptation in complex scenarios are achieved.
Patent Information
- Application Number
- CN202511460582.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-10-14
AI Technical Summary
Traditional RTOS network protocol stacks are limited by their single integration and inability to flexibly utilize multiple network protocol stacks. This restricts their application scenarios in complex gateways, mission-critical devices, and hybrid mission-critical systems, preventing them from fully leveraging the advantages of each network protocol stack.
By adapting the data source to at least two RTOS network protocol stacks based on the preset adaptation module and the network protocol stack configuration scheduling module, and customizing the usage ratio of each protocol stack, the integration and optimization of different RTOS network protocol stacks can be achieved. By combining software-level and hardware-level adaptation, the needs of different business scenarios can be met.
To improve the flexibility and effectiveness of RTOS network protocol stacks, meet diverse network protocol stack requirements, enable rich deployment and adaptability of RTOS in complex scenarios, avoid the limitations of a single protocol stack, and ensure system stability and feature richness.
Smart Images

Figure CN120935283B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of integrated circuit design technology and computer system technology, and in particular to an RTOS data processing method, apparatus, device and medium based on network protocol stack integration. Background Technology
[0002] RTOS (Real-Time Operating System) is an operating system designed specifically for real-time applications. Its core feature is the ability to perform task scheduling and resource management within strict time constraints. Its core design goals are "determinism" and "reliability". It is a core component of embedded systems, and the vast majority of embedded systems use RTOS.
[0003] The RTOS network protocol stack is a software component that runs on top of an RTOS. It implements a series of protocols required for computer network communication (such as TCP, UDP, IP, ICMP, ARP, etc.), enabling RTOS-based embedded devices to access networks (such as Ethernet, Wi-Fi, etc.) and perform reliable data transmission. The RTOS network protocol stack is the core component for implementing network communication in embedded systems. It is responsible for implementing network protocols (such as TCP / IP, UDP, HTTP, etc.) and handling packet encapsulation, decapsulation, routing, error detection, etc. The RTOS network protocol stack is typically provided to applications in the form of APIs, simplifying network communication development.
[0004] RTOS typically employs open-source network protocol stacks, including but not limited to the following: LwIP (Lightweight IP), a lightweight TCP / IP protocol stack suitable for resource-constrained embedded systems; uIP, another small TCP / IP protocol stack suitable for embedded systems and low-power devices; Contiki, an open-source IoT system supporting low-power communication; uC / TCP-IP, supporting multiple network protocols and device drivers; and Mbed OS, an IoT operating system supporting multiple connectivity methods.
[0005] In traditional technologies, based on the application scenarios and design philosophy of RTOS, RTOS typically integrates only a single network protocol stack. For example, uIP is chosen to emphasize minimal resource consumption; LwIP is chosen to achieve greater adaptability; uC / TCP-IP is chosen to support more protocols and devices; and Contiki is chosen to achieve low-power communication.
[0006] However, the inventors discovered that with the development of artificial intelligence, such as the development of IoT devices like wearable devices, smart home hubs, industrial gateways, and vehicle-to-everything (V2X) terminals, the application scenarios of RTOS are becoming increasingly diverse, and the demands on RTOS are becoming more varied. For example, in some business scenarios, RTOS needs to flexibly use several network protocol stacks to meet the needs of different situations and achieve the best overall performance. Sometimes, minimal resource consumption is required, sometimes greater adaptability is needed, sometimes support for more protocols and devices is needed, and sometimes low-power communication is needed. Traditional RTOSs, due to their integration of a single network protocol stack, cannot flexibly use multiple network protocol stacks simultaneously. This prevents them from fully leveraging the advantages of each network protocol stack and achieving multi-protocol stack integration to fully utilize the strengths of various network protocol stacks to meet the needs of different situations and achieve the best overall performance. This is especially true in application scenarios such as complex gateways, mission-critical equipment, hybrid mission-critical systems, and industrial equipment, which limits the application scenarios of RTOS.
[0007] Therefore, improving the flexibility of RTOS network protocol stack usage has become an urgent technical problem to be solved in RTOS, embedded systems, embedded devices, and IoT devices, among others. Summary of the Invention
[0008] This invention provides an RTOS data processing method, apparatus, computer equipment, and medium based on network protocol stack integration, to solve the technical problem of low flexibility in the use of RTOS network protocol stacks in traditional technologies.
[0009] Firstly, a method for processing RTOS data based on network protocol stack fusion is provided, comprising: adapting a data source to at least two preset RTOS network protocol stacks based on a preset adaptation module, and adapting a data target to all the preset RTOS network protocol stacks; determining the usage percentage of each preset RTOS network protocol stack based on a preset network protocol stack configuration and scheduling module in response to configuration operations based on a custom RTOS network protocol stack; determining initial business application data based on the data source; processing the initial business application data by calling all the preset RTOS network protocol stacks according to the RTOS, the preset adaptation module, the preset network protocol stack configuration and scheduling module, and the usage percentage, based on the preset adaptation module, the preset network protocol stack configuration and scheduling module, and the usage percentage, to obtain target data; and sending the target data to the data target.
[0010] Secondly, a data processing device based on network protocol stack fusion for RTOS is provided, comprising: a first adaptation module, used to adapt a data source end to at least two preset RTOS network protocol stacks and to adapt a data target end to all the preset RTOS network protocol stacks based on a preset adaptation module; a first determination module, used to determine the usage ratio of all the preset RTOS network protocol stacks in response to a configuration operation based on a custom RTOS network protocol stack; a second determination module, used to determine initial business application data based on the data source end; a first processing module, used to process the initial business application data based on the RTOS and according to the preset adaptation module, the preset network protocol stack configuration and scheduling module, and the usage ratio, respectively calling all the preset RTOS network protocol stacks to obtain target data; and a first sending module, used to send the target data to the data target end.
[0011] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0012] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described method.
[0013] In the aforementioned scheme implemented by the RTOS data processing method, apparatus, computer equipment, and storage medium based on network protocol stack fusion, the method adapts the data source end to at least two preset RTOS network protocol stacks and the data target end to all preset RTOS network protocol stacks; based on the preset network protocol stack configuration scheduling module, it responds to the configuration operation based on the use of a custom RTOS network protocol stack to determine the usage ratio of each preset RTOS network protocol stack; based on the RTOS and according to the usage ratio, it calls all preset RTOS network protocol stacks to process the initial business application data, thereby combining the software-level adaptation (network protocol stack and user program), hardware-level adaptation (network protocol stack and Ethernet card), and the usage ratio of different RTOS network protocol stacks configured by the user, to select different network protocol stack fusion strategies (i.e., fusion degree and fusion) of different network protocol stacks. By empowering users who best understand their business needs with the power of flexibility and adaptability, the requirements and characteristics of different RTOS network protocol stacks in different business application scenarios can be combined to achieve the integration and corresponding optimization of different RTOS network protocol stacks (complementary protocol stack optimization and network communication optimization). This allows the simultaneous use of different types of network protocol stacks on a single RTOS, enabling the RTOS to fully utilize the advantages of each network protocol stack. This not only avoids the limitations of a single network protocol stack but also ensures the complementary advantages and rich functionality of different network protocol stacks as a whole. It achieves RTOS network communication optimization that best suits the business application scenarios at the user level, improving the flexibility and effectiveness of RTOS network protocol stack usage. This satisfies and realizes the rich and diverse network protocol stack requirements and network communication optimizations in different business application scenarios, enabling more diverse scenario deployments and scenario adaptation of RTOS. Attached Figure Description
[0014] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 A flowchart illustrating the RTOS data processing method based on network protocol stack fusion provided in an embodiment of the present invention;
[0016] Figure 2 A schematic diagram of the overall framework of the RTOS data processing method based on network protocol stack fusion provided in an embodiment of the present invention;
[0017] Figure 3This is a schematic diagram of the first sub-process of the RTOS data processing method based on network protocol stack fusion provided in an embodiment of the present invention;
[0018] Figure 4 A schematic block diagram of an RTOS data processing device based on network protocol stack fusion provided in an embodiment of the present invention;
[0019] Figure 5 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0022] This invention provides an RTOS data processing method based on network protocol stack fusion. The method can be applied to, but is not limited to, RTOS, embedded systems, embedded devices, and IoT devices. It is also used in text generation based on large language models in the fields of integrated circuit design technology and computer system technology, including but not limited to integrated circuit design technology and computer system technology. For example, it can be used in IoT devices such as wearable devices, smart home hubs, industrial gateways, and vehicle networking terminals, including but not limited to RTOS, embedded systems, integrated circuit design technology and computer systems of embedded devices.
[0023] To address the technical problem of low flexibility in the use of RTOS network protocol stacks in traditional technologies, the inventors propose an RTOS data processing method based on network protocol stack fusion in this invention. The core idea of this invention is to combine software-level adaptation (network protocol stack and user program), hardware-level adaptation (network protocol stack and Ethernet card), and custom configuration of network protocol stack usage ratios to integrate the different RTOS network protocol stack requirements and characteristics under different business application scenarios. This achieves the fusion and corresponding optimization of different RTOS network protocol stacks (complementary protocol stack optimization and network communication optimization), improving the flexibility and effectiveness of RTOS network protocol stack usage. This satisfies and fulfills the rich and diverse network protocol stack requirements under different business application scenarios, enabling richer deployment and scenario adaptation of RTOS in more scenarios.
[0024] The following detailed description of some embodiments of the present invention is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0025] Please see Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating the RTOS data processing method based on network protocol stack fusion provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the overall framework of the RTOS data processing method based on network protocol stack fusion provided in an embodiment of the present invention. Figure 1 As shown, the method includes, but is not limited to, the following steps S11-S15:
[0026] S11. Based on the preset adaptation module, the data source end is adapted to at least two preset RTOS network protocol stacks, and the data target end is adapted to all the preset RTOS network protocol stacks.
[0027] Explained, a pre-configured adaptation module, or preset adaptation module, refers to a module that adapts the data source to at least two preset RTOS network protocol stacks, or a module that adapts the data destination to at least two preset RTOS network protocol stacks. Here, RTOS network protocol stacks refer to network protocol stacks suitable for RTOS. The relevant network protocol stacks are shown above and will not be repeated here. Furthermore, during data flow, the data source is the originating end of the data, and the data destination is the receiving end of the data; they are the opposite ends of the data flow channel. For example... Figure 2As shown in the example, the preset adaptation module includes a preset application API adaptation module and a preset network protocol stack data transceiver adaptation module. The preset application API adaptation module adapts the user program to all preset RTOS network protocol stacks, and the preset network protocol stack data transceiver adaptation module adapts the Ethernet controller to all preset RTOS network protocol stacks. Furthermore, in this embodiment of the invention, for the user program sending data, the user program is the data source and the Ethernet card is the data destination; for the user program receiving data, the Ethernet card is the data source and the user program is the data destination.
[0028] Based on the above concept and setup, and using a pre-defined adaptation module, the data source is adapted to at least two pre-defined RTOS network protocol stacks, and the data destination is adapted to all pre-defined RTOS network protocol stacks. These pre-defined RTOS network protocol stacks are set by relevant personnel according to the needs of the business application scenario and the characteristics of different network protocol stacks. For example, they may include, but are not limited to, at least two of the following: LwIP (Lightweight IP), uIP, Contiki, uC / TCP-IP, and MbedOS. Figure 2 As shown in this example, the user program is adapted to the preset RTOS first network protocol stack and the preset RTOS second network protocol stack based on the preset application API adaptation module; the Ethernet controller is adapted to the preset RTOS first network protocol stack and the preset RTOS second network protocol stack based on the preset network protocol stack data transceiver adaptation module.
[0029] S12. Based on the preset network protocol stack configuration scheduling module, respond to the configuration operation based on the use of the custom RTOS network protocol stack, and determine the usage ratio of all the preset RTOS network protocol stacks.
[0030] Explained, the pre-configured network protocol stack scheduling module allows users to define the usage ratio of different RTOS network protocol stacks during RTOS network communication and determines which RTOS network protocol stack module to invoke based on the usage ratio. This usage ratio can be a data volume ratio or a time ratio. For example, network protocol stack A might handle 60% of the data volume, and network protocol stack B might handle 40%. Similarly, for a time ratio, network protocol stack A might handle 60% of the data within a given time period, and network protocol stack B might handle 40%. For instance, the ratio of network protocol stack A to network protocol stack B can be defined using the `netstack_config.cfg` configuration file. Users can edit this configuration file using a corresponding interface or editor to customize the corresponding RTOS network protocol stack allocation. By allowing users to customize the usage ratio of network protocol stack A and network protocol stack B during RTOS network communication, the most suitable RTOS network communication for the user's business application scenario can be achieved.
[0031] Based on the above concept and setup, and using the preset network protocol stack configuration scheduling module, users can customize the usage ratio of different preset RTOS network protocol stacks through configuration operations. In response to the above configuration operations, the usage ratio of each preset RTOS network protocol stack is determined. For example, the usage ratio of network protocol stack A is determined, and the usage ratio of network protocol stack B is determined.
[0032] S13. Based on the data source, determine the initial business application data.
[0033] Explained as described above, in this embodiment of the invention, for the user program to send data, the user program is the data source and the Ethernet card is the data destination; for the user program to receive data, the Ethernet card is the data source and the user program is the data destination. Thus, for the user program to send data, the data sent by the user program is the initial service application data; for the user program to receive data, the data obtained by the Ethernet card from the external network transmission is the initial service application data.
[0034] S14. Based on the RTOS, and according to the preset adaptation module, the preset network protocol stack configuration scheduling module and the usage ratio, call all the preset RTOS network protocol stacks respectively to process the initial business application data to obtain the target data;
[0035] S15. Send the target data to the data target terminal.
[0036] Explanatory, as stated above, and further reading Figure 2 For user programs sending data, the target RTOS network protocol stack is determined based on the usage ratio of a single preset RTOS network protocol stack. Then, based on the adaptation of the preset application API adaptation module and the call of the preset network protocol stack configuration scheduling module, the target RTOS network protocol stack is invoked. Based on the target RTOS network protocol stack, the data sent by the user program is processed accordingly to obtain the target data. Finally, based on the adaptation of the preset network protocol stack data transceiver adaptation module, the target data is sent to the Ethernet card and transmitted over the network.
[0037] For the user program to receive data, the Ethernet card obtains data from the external network, determines the target RTOS network protocol stack based on the usage ratio corresponding to a single preset RTOS network protocol stack, and calls the target RTOS network protocol stack based on the preset network protocol stack data transceiver adaptation module to process the data obtained by the Ethernet card from the external network to obtain the target data. Then, according to the adaptation corresponding to the preset application API adaptation module and the call of the preset network protocol stack configuration scheduling module, the target data is sent to the user program.
[0038] This invention, through adapting the data source to at least two preset RTOS network protocol stacks and the data destination to all preset RTOS network protocol stacks; based on the preset network protocol stack configuration scheduling module, responding to configuration operations based on the use of custom RTOS network protocol stacks, determining the usage ratio of each preset RTOS network protocol stack; and based on the RTOS and according to the usage ratio, calling each preset RTOS network protocol stack to process the initial business application data. By combining software-level adaptation (network protocol stack and user program), hardware-level adaptation (network protocol stack and Ethernet card), and the usage ratio of different RTOS network protocol stacks in the custom configuration, the power to choose the integration strategy (i.e., the degree and flexibility of integration) and flexibility of different network protocol stacks is given to the user who best understands their business. Thus, the requirements and characteristics of different RTOS network protocol stacks in business application scenarios are combined, achieving the integration and corresponding optimization of different RTOS network protocol stacks (complementary protocols of different network protocol stacks). (Stack optimization and network communication optimization) enables the simultaneous use of different types of network protocol stacks on a single RTOS. This allows the RTOS to fully leverage the advantages of each network protocol stack, ensuring that traffic is distributed across different network protocol stacks based on usage probability at different times. This guarantees that no single data stream can monopolize all resources, avoiding the limitations of a single network protocol stack and ensuring fairness and system stability in the overall service. Furthermore, it ensures the complementary advantages and rich functionality of different network protocol stacks, achieving RTOS network communication optimization that best suits the user's business application scenarios. This improves the flexibility and effectiveness of RTOS network protocol stack usage, meeting and implementing rich and diverse network protocol stack requirements and network communication optimizations in different business application scenarios. Especially in application scenarios such as complex gateways, mission-critical equipment, hybrid mission-critical systems, and industrial equipment, by sacrificing some resources and complexity, it addresses the fundamental shortcomings of a single network protocol stack in terms of security, real-time performance, functionality, and heterogeneous compatibility, enabling richer scenario deployments and scenario adaptation for the RTOS.
[0039] In one embodiment, a preset network protocol stack configuration scheduling module responds to a configuration operation based on the use of a custom RTOS network protocol stack, and determines the usage percentage corresponding to all the preset RTOS network protocol stacks, including:
[0040] Based on the preset network protocol stack configuration scheduling module, the RTOS network protocol stack configuration operation is performed in response;
[0041] Based on the configuration operation, determine the usage percentage of each of the preset RTOS network protocol stacks.
[0042] Explained as described above, when the preset network protocol stack configuration scheduling module responds to configuration operations based on the use of custom RTOS network protocol stacks and determines the usage ratio of all preset RTOS network protocol stacks, user program developers or system architects, etc., can customize the usage ratio of RTOS network protocol stacks through the corresponding interface or editor according to their business experience or business needs. The module responds to user operations to configure the usage ratio of RTOS network protocol stacks and determines the usage ratio of all preset RTOS network protocol stacks based on the configuration operations. This optimizes the communication network of the user's business, achieving the allocation and integration of network protocol stacks, including but not limited to those characterized by high bandwidth and those characterized by high real-time performance.
[0043] This invention, through customized configuration of the usage ratio of different RTOS network protocol stacks, empowers users who best understand their business to choose the integration strategy (i.e., degree and consistency) and flexibility of different network protocol stacks. Based on this, it combines the requirements and characteristics of different RTOS network protocol stacks in business application scenarios, achieving the integration of different RTOS network protocol stacks and the optimization of complementary protocol stacks and network communication. Overall, it ensures the complementary advantages and rich functionality of different network protocol stacks, achieving RTOS network communication optimization that best suits the business application scenarios at the user level. This improves the flexibility and effectiveness of RTOS network protocol stack usage, enabling richer scenario deployment and scenario adaptation of RTOS.
[0044] In one embodiment, based on a preset adaptation module, the data source is adapted to at least two preset RTOS network protocol stacks, and the data destination is adapted to all of the preset RTOS network protocol stacks, including:
[0045] Based on the preset application API adaptation module, the user program is adapted to all the preset RTOS network protocol stacks;
[0046] Based on the preset network protocol stack data transceiver adaptation module, the Ethernet controller is adapted to all the preset RTOS network protocol stacks.
[0047] Explanatory, as stated above, and further reading Figure 2A pre-configured application API adaptation module, also known as a preset application API adaptation module, is a module that adapts the network protocol stack to the user program by encapsulating the network protocol stack into application APIs. This module interfaces with the user program, allowing it to use the corresponding network protocol stack. Typically, the programming interfaces of different network protocol stacks are encapsulated, and then the corresponding API functions are provided to the application in a unified manner. The pre-configured application API adaptation module encapsulates API functions such as access(), bind(), connect(), listen(), recv(), recvfrom(), recvmsg(), send(), sendmsg(), sendto(), and socket(). The application program uses these encapsulated API functions for application programming. Furthermore, the pre-configured application API adaptation module determines which network protocol stack to use based on the preset network protocol stack configuration scheduling module (e.g., the netstack_config.cfg file).
[0048] Furthermore, a pre-configured network protocol stack data transceiver adaptation module is included. This module adapts the network protocol stack for data transceiver purposes and can be represented by `net_interface` (i.e., network interface). It interfaces downwards with the Ethernet controller's packet transmission and reception functions, primarily using `netif_gmac_input()` and `netif_gmac_output`, and upwards with the network protocol stack's data transmission and reception functions, primarily using `netstack_lowlevel_input()` and `netstack_lowlevel_output()`. The pre-configured module mainly encapsulates the APIs of various network protocol stacks, including:
[0049] 1) netstack_lowlevel_init() is an important function used to initialize the network card hardware. Its main task is to perform a series of initialization tasks on the network card and connect to the common interface of the network protocol stack.
[0050] 2) netif_gmac_init() is used for the initialization of the Ethernet controller and is the function interface of the specific network card's gmac.
[0051] 3) netstack_lowlevel_input(), an important function in the protocol stack used to receive data packets from the network card and encapsulate them into a pbuf structure;
[0052] 4) netif_gmac_input(), is the packet receiving function of the Ethernet controller, and is the function interface of the specific network card gmac;
[0053] 5) netstack_lowlevel_output(), an important function in the protocol stack used to send data packets from the network card and encapsulate them into a pbuf structure;
[0054] 6) netif_gmac_input(), is the packet sending function of the Ethernet controller, and is the function interface of the specific network card gmac;
[0055] 7) netif_isr_task_routine() is the packet receiving task function of the Ethernet controller. It is mainly used to handle the interrupt service request (ISR) of the network interface. The main responsibilities of this function include monitoring the status changes of the network interface, processing the received data frames, and updating the status of the network interface according to the network connection status.
[0056] Based on the above concept and setup, the user program is adapted to all preset RTOS network protocol stacks using the preset application API adaptation module; and the Ethernet controller is adapted to all the preset RTOS network protocol stacks using the preset network protocol stack data transceiver adaptation module.
[0057] Therefore, combined with the preset network protocol stack configuration and scheduling module, which includes a preset application API adaptation module that decouples the application from the specific network protocol stack, hiding the differences between different protocol stacks (such as network protocol stack A and network protocol stack B) from the application, this is a software-level adaptation of the network protocol stack; a preset network protocol stack data transmission and reception adaptation module that decouples the network protocol stack from the specific underlying network card driver, adapting to the underlying network card driver at the bottom and adapting to the data transmission and reception requirements of different network protocol stacks and the custom configuration of the network protocol stack usage ratio at the top, this is a hardware-level adaptation of the network protocol stack; and a preset network protocol stack configuration and scheduling module that enables the custom configuration of the network protocol stack usage ratio. Thus, by combining the preset application API adaptation module, the preset network protocol stack configuration and scheduling module, and the preset network protocol stack data transmission and reception adaptation module, the application, network protocol stack, and underlying network card driver in traditional technologies are decoupled, achieving flexibility in the network protocol stack.
[0058] This invention adapts user programs and Ethernet controllers to all preset RTOS network protocol stacks. Based on the customized RTOS network protocol stack usage ratio, it combines the requirements and characteristics of different RTOS network protocol stacks in business application scenarios. This achieves the fusion of different RTOS network protocol stacks and the optimization of complementary protocol stacks and network communication, thereby improving the flexibility and effectiveness of RTOS network protocol stack usage and enabling richer scenario deployment and scenario adaptation of RTOS.
[0059] Please see Figure 3 , Figure 3 This is a schematic diagram of the first sub-process of the RTOS data processing method based on network protocol stack fusion provided in an embodiment of the present invention. Figure 3 As shown, in this embodiment, based on the RTOS, and according to the preset adaptation module, the preset network protocol stack configuration scheduling module, and the usage ratio, all the preset RTOS network protocol stacks are invoked respectively to process the initial service application data to obtain target data, including:
[0060] S31. Determine the first usage time corresponding to the preset RTOS first network protocol stack based on the usage ratio corresponding to the preset RTOS first network protocol stack;
[0061] S32. Determine the second usage time corresponding to the preset RTOS second network protocol stack based on the usage ratio corresponding to the preset RTOS second network protocol stack, wherein the second usage time is different from the first usage time;
[0062] S33. Based on the RTOS, and according to the preset adaptation module and the preset network protocol stack configuration scheduling module, during the first usage time, the preset RTOS first network protocol stack is called to process the initial business application data to obtain the first target data.
[0063] S34. Based on the RTOS, and according to the preset adaptation module and the preset network protocol stack configuration scheduling module, during the second usage time, the preset RTOS second network protocol stack is invoked to process the initial service application data to obtain the second target data.
[0064] S35. Determine the first target data and the second target data as the target data.
[0065] Explained, based on the user's configuration of the usage percentage corresponding to each preset RTOS network protocol stack, all preset RTOS network protocol stacks are invoked in a time-sharing manner, i.e.:
[0066] Based on the usage percentage corresponding to the first network protocol stack of the preset RTOS, the first usage time corresponding to the first network protocol stack of the preset RTOS is determined; based on the usage percentage corresponding to the second network protocol stack of the preset RTOS, the second usage time corresponding to the second network protocol stack of the preset RTOS is determined, wherein the second usage time is different from the first usage time.
[0067] Then, based on the RTOS and according to the preset adaptation module and preset network protocol stack configuration scheduling module, in the first usage time, the preset RTOS first network protocol stack is invoked to process the initial business application data to obtain the first target data; and, based on the RTOS and according to the preset adaptation module and preset network protocol stack configuration scheduling module, in the second usage time, the preset RTOS second network protocol stack is invoked to process the initial business application data to obtain the second target data; finally, the first target data and the second target data are determined as the target data. It should be noted that, in this embodiment of the invention, since at least two preset RTOS network protocol stacks are used, that is, in this embodiment of the invention, at least the preset RTOS first network protocol stack and the preset RTOS second network protocol stack are used, more RTOS network protocol stacks can be included on this basis, and so on, which will not be elaborated here, thereby realizing the time-sharing invocation of each RTOS network protocol stack.
[0068] Further, based on the usage percentage corresponding to the preset RTOS first network protocol stack, the first usage time corresponding to the preset RTOS first network protocol stack is determined, including:
[0069] Based on the usage percentage corresponding to the preset RTOS first network protocol stack, a number of time slices corresponding to the preset RTOS first network protocol stack are determined, and the time slices are used as the first usage time.
[0070] Specifically, a time slice, also known as a quantum, is a small segment of CPU time allocated by the operating system to each runnable process. Based on the data volume and data processing speed, the usage ratio of each preset RTOS network protocol stack can be quantified into a corresponding time slice. Thus, based on the usage ratio corresponding to the preset RTOS first network protocol stack, several time slices corresponding to the preset RTOS first network protocol stack are determined, and these time slices are used as the first usage time. Similarly, based on the usage ratio corresponding to the preset RTOS second network protocol stack, several time slices corresponding to the preset RTOS second network protocol stack are determined, and these time slices are used as the second usage time, and so on.
[0071] This invention, through time-sharing invocation of all preset RTOS network protocol stacks, achieves a customized usage ratio for different RTOS network protocol stacks. This empowers users who best understand their business to choose the integration strategy (i.e., degree and extent of integration) and flexibility for selecting different network protocol stacks. Based on this, it combines the requirements and characteristics of different RTOS network protocol stacks in business application scenarios, achieving integration and complementary protocol stack optimization, and network communication optimization. Overall, it ensures the complementary advantages and rich functionality of different network protocol stacks, achieving RTOS network communication optimization at the user level that best suits business application scenarios. This improves the flexibility and effectiveness of RTOS network protocol stack usage, enabling richer scenario deployments and scenario adaptation for RTOS.
[0072] In one embodiment, the data source is a user program, and the data target is an Ethernet controller; based on an RTOS, and according to the preset adaptation module and the preset network protocol stack configuration scheduling module, during the first usage time, the preset RTOS first network protocol stack is invoked to process the initial service application data to obtain the first target data, including:
[0073] Based on the RTOS, and according to the preset application API adaptation module and the preset network protocol stack configuration scheduling module, during the first usage time, the preset RTOS first network protocol stack is called to process the initial business application data to obtain the first target data.
[0074] Furthermore, sending the target data to the data target terminal includes:
[0075] Based on the preset network protocol stack data transceiver adaptation module, the first target data is sent to the Ethernet controller.
[0076] Explained as described above, for data sent by a user program, the data source is the user program and the data destination is the Ethernet controller. Therefore, based on the RTOS and according to the preset application API adaptation module and the preset network protocol stack configuration scheduling module, the preset RTOS first network protocol stack is invoked during the first usage time to process the initial business application data to obtain the first target data. Then, based on the preset network protocol stack data transceiver adaptation module, the first target data is sent to the Ethernet controller.
[0077] Preset RTOS second network protocol stack and other preset RTOS network protocol stacks, and so on.
[0078] In this embodiment of the invention, by adapting the user program to all preset RTOS network protocol stacks and the Ethernet controller to all preset RTOS network protocol stacks according to the preset application API adaptation module, the preset network protocol stack configuration scheduling module, and the preset network protocol stack data transmission and reception adaptation module, the invention combines the different network protocol stack requirements and characteristics in RTOS-based business data transmission application scenarios based on the customized RTOS network protocol stack usage ratio. This achieves the integration of different network protocol stacks and the optimization of complementary protocol stacks and network communication, thereby improving the flexibility and effectiveness of RTOS network protocol stack usage and enabling richer scenario deployment and scenario adaptation of RTOS.
[0079] In one embodiment, the data source is an Ethernet controller, and the data target is a user program; based on an RTOS, and according to the preset adaptation module and the preset network protocol stack configuration scheduling module, during the first usage time, the preset RTOS first network protocol stack is invoked to process the initial service application data to obtain the first target data, including:
[0080] Based on the RTOS and according to the preset network protocol stack data transceiver adaptation module, during the first usage time, the preset RTOS first network protocol stack is invoked to process the initial business application data to obtain the first target data.
[0081] Furthermore, sending the target data to the data target terminal includes:
[0082] The first target data is sent to the user program according to the preset network protocol stack configuration scheduling module and the preset application API adaptation module.
[0083] Explained as described above, for the user program to receive data, the data source is the Ethernet controller and the data destination is the user program. Therefore, based on the RTOS and according to the preset network protocol stack data transceiver adaptation module, the preset RTOS first network protocol stack is called at the first usage time to process the initial business application data to obtain the first target data. Then, according to the preset network protocol stack configuration scheduling module and the preset application API adaptation module, the first target data is sent to the user program.
[0084] Preset RTOS second network protocol stack and other preset RTOS network protocol stacks, and so on.
[0085] In this embodiment of the invention, by adapting the user program to all preset RTOS network protocol stacks and the Ethernet controller to all preset RTOS network protocol stacks according to the preset application API adaptation module, the preset network protocol stack configuration scheduling module, and the preset network protocol stack data transmission and reception adaptation module, the invention combines the different network protocol stack requirements and characteristics in RTOS-based business data reception application scenarios based on the customized RTOS network protocol stack usage ratio. This achieves the integration of different network protocol stacks and the optimization of complementary protocol stacks and network communication, thereby improving the flexibility and effectiveness of RTOS network protocol stack usage and enabling richer scenario deployment and scenario adaptation of RTOS.
[0086] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0087] In one embodiment, an RTOS data processing apparatus based on network protocol stack fusion is provided, which corresponds one-to-one with the RTOS data processing method based on network protocol stack fusion described in the above embodiments. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic block diagram of an RTOS data processing device based on network protocol stack fusion, provided as an embodiment of the present invention. Figure 4 As shown, the RTOS data processing device 40 based on network protocol stack integration includes a first adaptation module 41, a first determination module 42, a second determination module 43, a first processing module 44, and a first sending module 45. The detailed descriptions of each of the above functional modules are as follows:
[0088] The first adaptation module 41 is used to adapt the data source end to at least two preset RTOS network protocol stacks based on the preset adaptation module, and to adapt the data target end to all the preset RTOS network protocol stacks.
[0089] The first determining module 42 is used to configure the scheduling module based on the preset network protocol stack, respond to the configuration operation based on the use of the custom RTOS network protocol stack, and determine the usage ratio corresponding to all the preset RTOS network protocol stacks.
[0090] The second determining module 43 is used to determine the initial business application data based on the data source.
[0091] The first processing module 44 is used to process the initial business application data based on the RTOS and according to the preset adaptation module, the preset network protocol stack configuration scheduling module and the usage ratio, respectively calling all the preset RTOS network protocol stacks to obtain the target data.
[0092] The first sending module 45 is used to send the target data to the data target terminal.
[0093] In one embodiment, the first determining module 42 includes:
[0094] The response submodule is used to configure the scheduling module based on the preset network protocol stack and to perform RTOS network protocol stack configuration operations in response.
[0095] The first determining submodule is used to determine the usage percentage of all the preset RTOS network protocol stacks based on the configuration operation.
[0096] In one embodiment, the first adaptation module 41 includes:
[0097] The first adaptation submodule is used to adapt the user program to all the preset RTOS network protocol stacks based on the preset application API adaptation module.
[0098] The second adaptation submodule is used to adapt the Ethernet controller to all the preset RTOS network protocol stacks based on the preset network protocol stack data transceiver adaptation module.
[0099] In one embodiment, the first processing module 44 includes:
[0100] The second determining submodule is used to determine the first usage time corresponding to the preset RTOS first network protocol stack based on the usage ratio corresponding to the preset RTOS first network protocol stack.
[0101] The third determining submodule is used to determine the second usage time corresponding to the preset RTOS second network protocol stack based on the usage ratio corresponding to the preset RTOS second network protocol stack, wherein the second usage time is different from the first usage time;
[0102] The first calling submodule is used to call the preset RTOS first network protocol stack to process the initial business application data and obtain the first target data based on the RTOS and according to the preset adaptation module and the preset network protocol stack configuration scheduling module during the first usage time.
[0103] The second calling submodule is used to, based on the RTOS and according to the preset adaptation module and the preset network protocol stack configuration scheduling module, call the preset RTOS second network protocol stack during the second usage time to process the initial business application data and obtain the second target data.
[0104] The fourth determining submodule is used to determine that the first target data and the second target data are the target data.
[0105] In one embodiment, the second determining submodule is specifically used to determine a number of time slices corresponding to the preset RTOS first network protocol stack based on the usage ratio corresponding to the preset RTOS first network protocol stack, and to use the time slices as the first usage time.
[0106] In one embodiment, the data source is a user program, and the data target is an Ethernet controller; the first calling submodule is specifically used to call the preset RTOS first network protocol stack during the first usage time, based on the RTOS and according to the preset application API adaptation module and the preset network protocol stack configuration scheduling module, to process the initial business application data and obtain the first target data.
[0107] Furthermore, the first sending module 45 is specifically used to send the first target data to the Ethernet controller based on the preset network protocol stack data transceiver adaptation module.
[0108] In one embodiment, the data source is an Ethernet controller, and the data target is a user program; the first calling submodule is specifically used to, based on the RTOS and according to the preset network protocol stack data transceiver adaptation module, call the preset RTOS first network protocol stack during the first usage time to process the initial business application data and obtain the first target data.
[0109] Furthermore, the first sending module 45 is specifically used to send the first target data to the user program according to the preset network protocol stack configuration scheduling module and the preset application API adaptation module.
[0110] This invention provides an RTOS data processing device based on network protocol stack integration. It adapts the data source to at least two preset RTOS network protocol stacks and the data destination to all preset RTOS network protocol stacks. A preset network protocol stack configuration scheduling module responds to configuration operations based on custom RTOS network protocol stack usage, determining the usage percentage of each preset RTOS network protocol stack. Based on the RTOS and according to the usage percentage, all preset RTOS network protocol stacks are invoked to process the initial business application data. By combining software-level adaptation (network protocol stack and user program), hardware-level adaptation (network protocol stack and Ethernet card), and custom configuration of the usage percentage of different RTOS network protocol stacks, the device improves the flexibility and effectiveness of RTOS network protocol stack usage. This satisfies and optimizes network communication for diverse business application scenarios, enabling richer scenario deployment and scenario adaptation of the RTOS.
[0111] Specific limitations regarding the RTOS data processing device based on network protocol stack integration can be found in the limitations of the RTOS data processing method based on network protocol stack integration mentioned above, and will not be repeated here. Each module in the aforementioned RTOS data processing device based on network protocol stack integration can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.
[0112] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps of an RTOS data processing method based on network protocol stack integration.
[0113] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the RTOS data processing method based on network protocol stack fusion described in the above embodiments.
[0114] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the RTOS data processing method based on network protocol stack fusion described in the above embodiments.
[0115] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0116] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0117] The software tools or components not belonging to our company that appear in the embodiments of this invention are merely illustrative examples and do not represent actual use.
[0118] The data collection in this embodiment of the invention complies with the requirements of relevant laws and regulations, such as China's Personal Information Protection Law, GDPR (General Data Protection Regulation of the European Union), or information security standards of other countries and regions.
[0119] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. An RTOS data processing method based on network protocol stack fusion, characterized in that, The method comprises the following steps: based on the preset adaptation module, the data source end is adapted to at least two preset RTOS network protocol stacks, and the data target end is adapted to all the preset RTOS network protocol stacks; based on the preset network protocol stack configuration scheduling module, in response to the configuration operation based on the use of the custom RTOS network protocol stack, the use proportion corresponding to all the preset RTOS network protocol stacks is determined; based on the RTOS, and according to the preset adaptation module, the preset network protocol stack configuration scheduling module and the use proportion, all the preset RTOS network protocol stacks are called respectively to process the initial business application data to obtain target data; the target data is sent to the data target end. based on the preset network protocol stack configuration scheduling module, in response to the configuration operation based on the use of the custom RTOS network protocol stack, the use proportion corresponding to all the preset RTOS network protocol stacks is determined, which comprises:
2. The RTOS data processing method based on network protocol stack fusion according to claim 1, characterized in that, based on the preset network protocol stack configuration scheduling module, the configuration operation of the RTOS network protocol stack is responded; according to the configuration operation, the use proportion corresponding to all the preset RTOS network protocol stacks is determined. based on the preset adaptation module, the data source end is adapted to at least two preset RTOS network protocol stacks, and the data target end is adapted to all the preset RTOS network protocol stacks, which comprises:
3. The RTOS data processing method based on network protocol stack fusion according to claim 1, characterized in that, based on the preset application API adaptation module, the user program is adapted to all the preset RTOS network protocol stacks; based on the preset network protocol stack data receiving and sending adaptation module, the Ethernet controller is adapted to all the preset RTOS network protocol stacks. based on the RTOS, and according to the preset adaptation module, the preset network protocol stack configuration scheduling module and the use proportion, all the preset RTOS network protocol stacks are called respectively to process the initial business application data to obtain target data, which comprises:
4. The RTOS data processing method based on network protocol stack fusion according to claim 3, characterized in that, according to the use proportion corresponding to the preset RTOS first network protocol stack, the first use time corresponding to the preset RTOS first network protocol stack is determined; according to the use proportion corresponding to the preset RTOS second network protocol stack, the second use time corresponding to the preset RTOS second network protocol stack is determined, wherein the second use time and the first use time are different times; based on the RTOS, and according to the preset adaptation module and the preset network protocol stack configuration scheduling module, at the first use time, the preset RTOS first network protocol stack is called to process the initial business application data to obtain first target data; based on the RTOS, and according to the preset adaptation module and the preset network protocol stack configuration scheduling module, at the second use time, the preset RTOS second network protocol stack is called to process the initial business application data to obtain second target data; it is determined that the first target data and the second target data are the target data. 5. The RTOS data processing method based on network protocol stack fusion according to claim 4, characterized in that, According to the use proportion corresponding to the preset RTOS first network protocol stack, a first use time corresponding to the preset RTOS first network protocol stack is determined, including: According to the use proportion corresponding to the preset RTOS first network protocol stack, a plurality of time slices corresponding to the preset RTOS first network protocol stack are determined, and the time slices are used as the first use time.
6. The RTOS data processing method based on network protocol stack fusion according to claim 4, characterized in that, The data source end is a user program, and the data target end is an Ethernet controller; based on RTOS, and according to the preset adaptation module and the preset network protocol stack configuration scheduling module, in the first use time, the preset RTOS first network protocol stack is called to process the initial business application data, and first target data is obtained, including: Based on RTOS, and according to the preset application API adaptation module and the preset network protocol stack configuration scheduling module, in the first use time, the preset RTOS first network protocol stack is called to process the initial business application data, and first target data is obtained; And the target data is sent to the data target end, including: Based on the preset network protocol stack data transceiver adaptation module, the first target data is sent to the Ethernet controller.
7. The RTOS data processing method based on network protocol stack fusion according to claim 4, characterized in that, The data source end is an Ethernet controller, and the data target end is a user program; based on RTOS, and according to the preset adaptation module and the preset network protocol stack configuration scheduling module, in the first use time, the preset RTOS first network protocol stack is called to process the initial business application data, and first target data is obtained, including: Based on RTOS, and according to the preset network protocol stack data transceiver adaptation module, in the first use time, the preset RTOS first network protocol stack is called to process the initial business application data, and first target data is obtained; And the target data is sent to the data target end, including: According to the preset network protocol stack configuration scheduling module and the preset application API adaptation module, the first target data is sent to the user program.
8. An RTOS data processing apparatus based on network protocol stack fusion, characterized by, Including: The first adaptation module is used for adapting the data source end and at least two preset RTOS network protocol stacks based on the preset adaptation module, and adapting the data target end and all the preset RTOS network protocol stacks; The first determination module is used for determining the use proportion corresponding to all the preset RTOS network protocol stacks based on the preset network protocol stack configuration scheduling module in response to the configuration operation based on the custom RTOS network protocol stack; The second determination module is used for determining the initial business application data based on the data source end; The first processing module is used for calling all the preset RTOS network protocol stacks to process the initial business application data based on RTOS, and according to the preset adaptation module, the preset network protocol stack configuration scheduling module and the use proportion, and obtaining target data; The first sending module is used for sending the target data to the data target end.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The computer program is executed by the processor to implement the steps of the network protocol stack fusion-based RTOS data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to implement the steps of the network protocol stack fusion-based RTOS data processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Real-time adaptive traffic scheduling method and system
CN117221246A
Communication method and device of one-cloud multi-core application, computer equipment and storage medium
CN117834704A