CN112769688B - Method and device for protocol stack adaptation, electronic equipment and storage medium - Google Patents

Method and device for protocol stack adaptation, electronic equipment and storage medium Download PDF

Info

Publication number
CN112769688B
CN112769688B CN202011513741.1A CN202011513741A CN112769688B CN 112769688 B CN112769688 B CN 112769688B CN 202011513741 A CN202011513741 A CN 202011513741A CN 112769688 B CN112769688 B CN 112769688B
Authority
CN
China
Prior art keywords
network card
application program
information
message
callback function
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.)
Active
Application number
CN202011513741.1A
Other languages
Chinese (zh)
Other versions
CN112769688A (en
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 Acoinfo Technology Co ltd
CSG Electric Power Research Institute
Southern Power Grid Digital Grid Research Institute Co Ltd
Original Assignee
Beijing Acoinfo Technology Co ltd
CSG Electric Power Research Institute
Southern Power Grid Digital Grid Research Institute 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 Acoinfo Technology Co ltd, CSG Electric Power Research Institute, Southern Power Grid Digital Grid Research Institute Co Ltd filed Critical Beijing Acoinfo Technology Co ltd
Priority to CN202011513741.1A priority Critical patent/CN112769688B/en
Publication of CN112769688A publication Critical patent/CN112769688A/en
Application granted granted Critical
Publication of CN112769688B publication Critical patent/CN112769688B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/251Translation of Internet protocol [IP] addresses between different IP versions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/16Gateway arrangements

Abstract

The embodiment of the invention discloses a method, a device, electronic equipment and a storage medium for protocol stack adaptation, wherein the protocol stack adaptation is executed under a driver framework, and the method comprises the following steps: acquiring application program registration callback function information; and controlling the application program to process the data message information received by the network card according to the application program registration callback function information. According to the method and the device, the protocol stack flow of non-special electric network card message processing and the flow of special electric network card message processing can be freely switched, intelligent adaptation of special electric network card data is completed through the matching of the driving program and the application program, the application program can autonomously acquire datagrams required by the application program, the data acquisition efficiency is improved, the coupling degree of the driving program and the application program is reduced, and the complexity of the driving program and the application program is reduced.

Description

Method and device for protocol stack adaptation, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of special power network card processing, in particular to a protocol stack adaptation method, a device, electronic equipment and a storage medium applied to automatic message processing of a patent power network card.
Background
The common protocol stack processes messages in various general formats in the network and has good support for the general network card. However, for professional power network card devices, various network messages in the power devices need to be specially processed, which results in complex data maintenance and higher coding design difficulty.
Accordingly, there is a need in the art for improvements.
Disclosure of Invention
The embodiment of the invention aims to solve the technical problem that: a method, an apparatus, an electronic device and a storage medium for protocol stack adaptation are provided to solve the problems in the prior art.
In an embodiment of the present application, the protocol stack adaptation is performed under a driver framework, and the method for protocol stack adaptation includes:
acquiring application program registration callback function information;
and controlling the application program to process data message information received by the network card according to the application program registration callback function information, wherein the data message information received by the network card comprises a special electric network card message received by the network card and a non-special electric network card message received by the network card.
In another embodiment, the obtaining the application registration callback function information includes:
providing a callback function adapted to an application program;
Sending the callback function to the application program;
and acquiring the registration information of the application program and the callback function.
In another embodiment, the controlling the application program to process the data packet information received by the network card according to the application program registration callback function information includes:
and when the application program does not register the callback function, acquiring the data message information received by the network card processed by the application program according to the network protocol stack.
In another embodiment, the controlling the application program to process the data packet information received by the network card according to the application program registration callback function information includes:
and when the application program registers the callback function, acquiring the information of the application program for processing the special power network card message according to the registered callback function information.
In another embodiment, the acquiring information of the application program for processing the dedicated power network card message according to the registered callback function information when the application program registers the callback function includes:
acquiring the callback function information registered by the application program;
registering the callback function information according to the application program, and controlling the application program to acquire a special electric network card message in a data message received by a network card;
Acquiring a special electric network card message in the data message received by the network card according to the application program, and acquiring the information of the special electric network card message processed by the application program according to program logic;
and processing the message information of the special power network card according to the application program to acquire the processing service mark information of the message of the power network card.
In another embodiment, the controlling the application program to obtain a dedicated power network card message in a data message received by a network card according to the callback function information registered by the application program includes:
acquiring data message information received by a network card;
sending the data message received by the network card to an application program according to the acquired data message information received by the network card;
controlling the application program to filter non-special electric network card messages in the data messages received by the network card;
and acquiring the message information of the special power network card in the data message received by the network card by the application program.
In another embodiment, the processing, by the application program according to the program logic, the message information of the dedicated power network card includes:
acquiring logic information of the application program;
acquiring processing state information of the special power network card message according to the logic information of the application program;
When the logic information of the application program processes the special power network card message, returning the special power network card message processing state information;
and returning the unprocessed state information of the special electric network card message when the logic information of the application program does not process the special electric network card message.
Based on another aspect of the embodiments of the present invention, a device for protocol stack adaptation is disclosed, which includes:
the acquisition module is used for acquiring application program registration callback function information;
and the control module is used for controlling the application program to process the data message information received by the network card according to the application program registration callback function information, wherein the data message information received by the network card comprises a special electric network card message received by the network card and a non-special electric network card message received by the network card.
In accordance with yet another aspect of an embodiment of the present invention, an electronic device is disclosed, the electronic device comprising one or more processors and memory for storing one or more programs; when the one or more programs are executed by the processor, the processor is enabled to implement the cell charging detection method provided by each embodiment of the present invention.
Based on still another aspect of the embodiments of the present invention, a computer-readable storage medium storing a computer program is disclosed, where the computer program is executed to implement the method for detecting battery cell charging provided in the embodiments of the present invention.
Compared with the prior art, the invention has the following advantages:
the method, the device, the electronic equipment and the storage medium for protocol stack adaptation are executed under a driver framework through the protocol stack adaptation, and the driver registers callback function information through acquiring an application program; according to the application program registration callback function information, the driver controls the application program to process the data message information received by the network card, free switching between a protocol stack process of non-special power network card message processing and a special power network card message processing process can be achieved, the processing requirement of the data message received by the network card can be met, intelligent adaptation of special power network card data is completed through cooperation of the driver and the application program, the application program can autonomously obtain datagrams required by the application program, the data obtaining efficiency is improved, meanwhile, the coupling degree of the driver and the application program is reduced, and the complexity of the driver and the application program is reduced.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
The invention will be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
FIG. 1 is a diagram illustrating an exemplary implementation of a protocol stack adaptation method;
FIG. 2 is a flow diagram of a method of protocol stack adaptation in one embodiment of the invention;
FIG. 3 is a flow diagram of a method of protocol stack adaptation in one embodiment of the invention;
FIG. 4 is a flow diagram of a method of protocol stack adaptation in one embodiment of the invention;
FIG. 5 is a block diagram of an apparatus for protocol stack adaptation in an embodiment of the present invention;
FIG. 6 is an apparatus for protocol stack adaptation in one embodiment;
FIG. 7 is a diagram illustrating an internal structure of an electronic device in one embodiment.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The protocol stack adaptation method provided by the application can be applied to the application environment shown in fig. 1. The method for protocol stack adaptation is applied to a device for protocol stack adaptation. The protocol stack adapting device can be configured in the terminal 102 or the server 104, or partially configured in the terminal 102 and partially configured in the server 104, and the method for adapting the protocol stack is completed by the interaction between the terminal 102 and the server 104.
Wherein the terminal 102 and the server 104 can communicate through a network.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, the terminal 102 needs to have a function of acquiring continuous multi-frame images, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
At present, a common protocol stack processes messages in various general formats in a network and has good support for a general network card. However, various network messages in the special power network card equipment need to be specially processed, and the existing common protocol stack processes the major defects and shortcomings of the network messages in the special power network card:
firstly, the driving code is complex and the maintenance difficulty is high. Due to the difference between the special power network card device and the common network card device, special operation needs to be performed on the power special network message in the network card driving code. The operation steps of identification, processing, distribution and the like of the special power network card message are added in the drive of the common network card equipment, and the complexity of the drive code of the common network card equipment is increased. Meanwhile, the maintenance difficulty of the drive code is increased for the processing of the electric power private network message. For different electric power professional network card devices, different network card driving codes need to be written, so that the number of driving codes of different versions is increased, and the versions of driving programs are not easy to maintain. Secondly, the application code is complex and the maintenance difficulty is high. The bottom layer data of the special power network card device is processed through a driver, and a specific interface is provided for an application program to use by the driver according to different scenes. The network card driving program distinguishes non-power dedicated network messages and power dedicated network messages, stores different types of data, and provides different data acquisition interfaces for the application program. The application program realizes respective processing on the non-power private network message and the power private network message according to the data acquisition interfaces provided by the different types of driving programs. The complexity of the driver code is increased, the complexity of the application code is also increased, and the application code is more difficult to maintain. Thirdly, the dependency degree of the application program and the driving program is high. The driver program provides a specific data stream storage and acquisition mode, and the application program calls a proper interface to complete the sending and receiving of the data packet according to the logic of the driver program and distinguishes non-electric power dedicated network messages and dedicated electric power network card messages. The strong dependence relationship between the application program and the driving program is not favorable for the expansion of the program function of the special power network card equipment.
In one embodiment, as shown in fig. 2, a method for protocol stack adaptation is provided, and this embodiment is mainly illustrated by applying the method to the terminal 102 in fig. 1.
Step 201, obtaining application program registration callback function information.
Specifically, in the embodiment of the present application, the protocol stack is adapted to be executed under a driver framework, the driver needs to first obtain an application registration callback function, and because the driver provides a specific version of the network card driver, which supports the dedicated power network card device, the driver needs to provide the callback function to the application, and after the application registers the callback function, the processing of the dedicated power network card message of the dedicated power network card device can be completed, and at this time, the driver can coordinate the processing of the non-power dedicated network message and the dedicated power network card message according to the condition that the application processes the dedicated power network card message.
Specifically, in an embodiment of the present application, the acquiring information of the application registration callback function includes:
callback functions adapted to the application are provided.
Specifically, when the dedicated power network card message of the patent power network card device is processed, the driver provides a callback function suitable for the patent power network card device, and the application program can execute processing of the dedicated power network card message in the data message information received by the network card only after registering the callback function.
And sending the callback function to the application program.
Specifically, after the driver provides the callback function adapted to the application program, the driver needs to send the callback function to the application layer where the application program is located, and the application layer can configure the interface of the special power network card according to the callback function, and receive the special power network card message and the non-special power network card message sent by the special power network card.
And acquiring the registration information of the application program and the callback function.
Specifically, after the driver sends the callback function adapted to the application program to the application layer, the application program located in the application layer will automatically register with the callback function.
Step 202, controlling the application program to process data message information received by the network card according to the application program registration callback function information, wherein the data message information received by the network card comprises a special electric network card message received by the network card and a non-special electric network card message received by the network card.
Specifically, after the application finishes registering to the callback function, the application can process the data message information sent by the network card device, where the network card device may be a dedicated power network card device or a non-dedicated power network card device, so that the data message information received by the network card may be a dedicated power network card message or a non-dedicated power network card message, and the application only processes the received dedicated power network card message and automatically filters the non-dedicated power network card message.
Specifically, in an embodiment of the present application, the controlling, according to the application registration callback function information, the application to process the data packet information received by the network card includes:
and when the application program does not register the callback function, acquiring the data message information received by the network card processed by the application program according to the network protocol stack.
Specifically, since the application program does not register a callback function, the application program cannot process the received message information of the special power network card, at this time, the application program processes the received data of all the network card devices according to a flow for processing the message information of the non-special power network card, and since the application program does not acquire the callback function of the driver program, the application program only has the capability of processing the message information of the non-special power network card according to the service logic of the application program.
Specifically, in an embodiment of the present application, the controlling, according to the application registration callback function information, the application to process the data packet information received by the network card includes:
and when the application program registers the callback function, acquiring the information of the application program for processing the special power network card message according to the registered callback function information.
Specifically, when the application registers the callback function, the application can automatically filter the data message information received by the network card, and after filtering the non-dedicated power network card message, can receive the dedicated power network card message, and process the dedicated power network card message information through the callback function.
Specifically, in a specific embodiment, as shown in fig. 3, the acquiring, when the application registers the callback function, information of the application processing the dedicated power network card message according to the registered callback function information includes:
step 301, obtaining the callback function information registered by the application program.
Specifically, when the application finishes registering the callback function, the driver acquires information that the application registers the callback function.
Step 302, according to the callback function information registered by the application program, controlling the application program to acquire a special electric network card message in the data message received by the network card.
Specifically, when the network card receives data, because the application program has completed registering the callback function, the application program automatically filters the dedicated power network card message from the data message received by the network card, automatically filters the non-dedicated power network card message without processing, and returns the unprocessed status flag of the non-dedicated power network card message which is not processed to the driver.
Step 303, acquiring a special electric network card message in the data message received by the network card according to the application program, and acquiring the information of the special electric network card message processed by the application program according to program logic;
specifically, after the application program obtains the message information of the special power network card, the special power network card message is processed according to the service logic of the application program, and the application program is a software program for performing corresponding function processing on the message information of the special power network card, so that the application program can complete processing on the received special power network card message according to the function of the edited program code and obtain a corresponding processing result.
And 304, processing the special electric network card message information according to the application program, and acquiring the processing service mark information of the electric network card message.
Specifically, after the application program processes the received message information of the special power network card, the state information of the completed processing needs to be returned to the driver program, the driver program determines whether the received message information of the power network card is completed or not, if the received message information of the power network card is completed, the corresponding data transmission is completed, and if the received message information of the power network card is not completed, the message information of the special power network card which is not completed is continuously sent to the application program until the corresponding processing is completed.
Specifically, as shown in fig. 4, in a specific embodiment, the controlling, according to the callback function information registered by the application program, the application program to acquire a dedicated power network card message in a data message received by a network card includes:
step 401, acquiring data message information received by a network card;
step 402, according to the acquired data message information received by the network card, sending the data message received by the network card to an application program;
step 403, controlling the application program to filter a non-dedicated power network card message in the data message received by the network card;
step 404, obtaining the message information of the special power network card in the data message received by the network card and received by the application program.
Specifically, as shown in fig. 5, in a specific embodiment, the processing, by the application program according to the program logic, the message information of the dedicated power network card includes:
step 501, acquiring logic information of the application program;
step 502, acquiring processing state information of the special power network card message according to the logic information of the application program;
step 503, when the logic information of the application program processes the special power network card message, returning the special power network card message processing state information;
step 504, when the logic information of the application program does not process the special power network card message, returning the unprocessed state information of the special power network card message.
The application is executed under the driver framework by adapting the protocol stack, and the driver calls back the function information by acquiring the application registration; according to the application program registration callback function information, the driver controls the application program to process the data message information received by the network card, free switching between a protocol stack process of non-special electric network card message processing and a special electric network card message processing process can be realized, the processing requirement of the data message received by the network card can be met, intelligent adaptation of special electric network card data is completed through the cooperation of the driver and the application program, the application program can autonomously acquire datagrams required by the application program, the data acquisition efficiency is improved, the coupling degree of the driver and the application program is reduced, and the complexity of the driver and the application program is reduced.
It should be understood that although the various steps in the flow diagrams of fig. 2-5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 6, there is provided a protocol stack adapting apparatus, which executes under a driver framework, including: the device comprises an acquisition module and a control module.
The acquisition module is used for acquiring application program registration callback function information;
and the control module is used for controlling the application program to process the data message information received by the network card according to the application program registration callback function information, wherein the data message information received by the network card comprises a special electric network card message received by the network card and a non-special electric network card message received by the network card.
Specifically, in another embodiment of the present application, the obtaining module is configured to provide a callback function adapted to an application program; sending the callback function to the application program; and acquiring the registration information of the application program and the callback function.
Specifically, in another embodiment of the present application, the obtaining module is configured to obtain, when the application program does not register the callback function, data packet information received by the network card processed by the application program according to a network protocol stack.
Specifically, in another embodiment of the present application, the obtaining module is configured to obtain, when the application registers the callback function, information of a dedicated power network card message processed by the application according to the registered callback function information.
Specifically, in another embodiment of the present application, the control module is configured to obtain information of the callback function registered by the application program; registering the callback function information according to the application program, and controlling the application program to acquire a special electric network card message in a data message received by a network card; acquiring a special electric network card message in the data message received by the network card according to the application program, and acquiring the information of the special electric network card message processed by the application program according to program logic; and processing the message information of the special power network card according to the application program to acquire the processing service mark information of the message of the power network card.
Specifically, in another embodiment of the present application, the control module is configured to obtain data message information received by a network card; sending the data message received by the network card to an application program according to the acquired data message information received by the network card; controlling the application program to filter non-special electric network card messages in the data messages received by the network card; and acquiring the message information of the special power network card in the data message received by the network card by the application program.
Specifically, in another embodiment of the present application, the control module is configured to obtain logic information of the application program; acquiring processing state information of the special power network card message according to the logic information of the application program; when the logic information of the application program processes the special power network card message, returning the special power network card message processing state information; and returning the unprocessed state information of the special electric network card message when the logic information of the application program does not process the special electric network card message.
The protocol stack adaptation device is executed under a driver framework through adaptation of the protocol stack, and the driver registers and recalls function information through acquiring an application program; according to the application program registration callback function information, the driver controls the application program to process the data message information received by the network card, free switching between a protocol stack process of non-special electric network card message processing and a special electric network card message processing process can be realized, the processing requirement of the data message received by the network card can be met, intelligent adaptation of special electric network card data is completed through the cooperation of the driver and the application program, the application program can autonomously acquire datagrams required by the application program, the data acquisition efficiency is improved, the coupling degree of the driver and the application program is reduced, and the complexity of the driver and the application program is reduced.
For specific limitations of the protocol stack adaptation apparatus, reference may be made to the above limitations of the protocol stack adaptation method, which are not described herein again. The modules in the protocol stack adaptation apparatus may be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 7. The electronic device comprises a processor, a memory, a communication interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the electronic device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, Near Field Communication (NFC) or other technologies. The computer program is executed by a processor to implement a method of protocol stack adaptation. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the electronic equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is a block diagram of only a portion of the architecture associated with the subject application, and does not constitute a limitation on the electronic devices to which the subject application may be applied, and that a particular electronic device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the protocol stack adaptation apparatus provided in the present application may be implemented in a form of a computer program, and the computer program may be run on an electronic device as shown in fig. 7. The memory of the electronic device may store various program modules constituting the protocol stack adaptation-based apparatus, such as the acquisition module and the control module shown in fig. 6. The respective program modules constitute computer programs that cause the processors to execute the steps in the method for protocol stack adaptation of the various embodiments of the present application described in the present specification.
For example, the electronic device shown in fig. 7 may obtain the application registration callback function information through the image obtaining module of the protocol stack adapted device shown in fig. 6; the electronic equipment can control the application program to process the data message information received by the network card through the control module according to the application program registration callback function information.
In one embodiment, a processor, when executing a computer program, performs the steps of: the protocol stack is adapted to be executed under a driver framework, and application registration callback function information is acquired; and controlling the application program to process data message information received by a network card according to the application program registration callback function information, wherein the data message information received by the network card comprises a special electric network card message and a non-special electric network card message.
In one embodiment, the processor, when executing the computer program, further performs the steps of: providing a callback function adapted to an application program; sending the callback function to the application program; and acquiring the registration information of the application program and the callback function.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and when the application program does not register the callback function, acquiring the data message information received by the network card processed by the application program according to the network protocol stack.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and when the application program registers the callback function, acquiring the information of the application program for processing the special power network card message according to the registered callback function information.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring the callback function information registered by the application program; registering the callback function information according to the application program, and controlling the application program to acquire a special electric network card message in a data message received by a network card; acquiring a special electric network card message in the data message received by the network card according to the application program, and acquiring the information of the special electric network card message processed by the application program according to program logic; and processing the message information of the special power network card according to the application program to acquire the processing service mark information of the message of the power network card.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring data message information received by a network card; sending the data message received by the network card to an application program according to the acquired data message information received by the network card; controlling the application program to filter non-special electric network card messages in the data messages received by the network card; and acquiring the message information of the special power network card in the data message received by the network card by the application program.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring logic information of the application program; acquiring processing state information of the special power network card message according to the logic information of the application program; when the logic information of the application program processes the special power network card message, returning the special power network card message processing state information; and returning the unprocessed state information of the special electric network card message when the logic information of the application program does not process the special electric network card message.
When the computer program is executed by the processor, the protocol stack is adapted to be executed under a driver framework, and the driver registers callback function information by acquiring an application program; according to the application program registration callback function information, the driver controls the application program to process the data message information received by the network card, free switching between a protocol stack process of non-special electric network card message processing and a special electric network card message processing process can be realized, the processing requirement of the data message received by the network card can be met, intelligent adaptation of special electric network card data is completed through the cooperation of the driver and the application program, the application program can autonomously acquire datagrams required by the application program, the data acquisition efficiency is improved, the coupling degree of the driver and the application program is reduced, and the complexity of the driver and the application program is reduced.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM is available in many forms, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), and the like.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for protocol stack adaptation, wherein the protocol stack adaptation is performed under a driver framework, comprising:
acquiring application registration callback function information, acquiring an application registration callback function by a driver, and providing the callback function to an application by the driver because the driver provides a network card driver with a specific version;
And controlling the application program to process data message information received by a network card according to the application program registration callback function information, wherein the data message information received by the network card comprises a special electric network card message and a non-special electric network card message.
2. The method of protocol stack adaptation according to claim 1, wherein said obtaining application registration callback function information comprises:
providing a callback function adapted to an application program;
sending the callback function to the application program;
and acquiring the registration information of the application program and the callback function.
3. The method for protocol stack adaptation according to claim 1, wherein the controlling the application program to process the data packet information received by the network card according to the application program registration callback function information comprises:
and when the application program does not register the callback function, acquiring the data message information received by the network card processed by the application program according to the network protocol stack.
4. The method for protocol stack adaptation according to claim 1, wherein the controlling the application program to process the data packet information received by the network card according to the application program registration callback function information comprises:
And when the application program registers the callback function, acquiring the information of the application program for processing the special power network card message according to the registered callback function information.
5. The method for protocol stack adaptation according to claim 4, wherein the obtaining, when the application registers the callback function, information of the application processing the dedicated power network card message according to the registered callback function information includes:
acquiring the callback function information registered by the application program;
registering the callback function information according to the application program, and controlling the application program to acquire a special electric network card message in a data message received by a network card;
acquiring a special electric network card message in the data message received by the network card according to the application program, and acquiring the information of the special electric network card message processed by the application program according to program logic;
and processing the message information of the special power network card according to the application program to acquire the processing service mark information of the message of the power network card.
6. The method for protocol stack adaptation according to claim 5, wherein the controlling the application program to obtain the dedicated power network card message in the data message received by the network card according to the callback function information registered by the application program comprises:
Acquiring data message information received by a network card;
sending the data message received by the network card to an application program according to the acquired data message information received by the network card;
controlling the application program to filter a non-special power network card message in a data message received by the network card;
and acquiring the message information of the special power network card in the data message received by the network card by the application program.
7. The method for protocol stack adaptation according to claim 5, wherein the processing, by the application program according to program logic, the dedicated power network card message information comprises:
acquiring logic information of the application program;
acquiring processing state information of the special power network card message according to the logic information of the application program;
when the logic information of the application program processes the special power network card message, returning the special power network card message processing state information;
and returning the unprocessed state information of the special electric network card message when the logic information of the application program does not process the special electric network card message.
8. An apparatus for protocol stack adaptation, wherein the apparatus for protocol stack adaptation is implemented under a driver framework, the apparatus comprising:
The acquisition module is used for acquiring the information of the application program registration callback function, the driver acquires the application program registration callback function, and the driver provides the callback function for the application program as the driver provides the network card driver with a specific version;
and the control module is used for controlling the application program to process the data message information received by the network card according to the application program registration callback function information, wherein the data message information received by the network card comprises a special electric network card message received by the network card and a non-special electric network card message received by the network card.
9. An electronic device, comprising one or more processors and memory, the memory to store one or more programs;
the one or more programs, when executed by the processor, cause the processor to implement the method of any of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed, implements the method of any one of claims 1 to 7.
CN202011513741.1A 2020-12-18 2020-12-18 Method and device for protocol stack adaptation, electronic equipment and storage medium Active CN112769688B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011513741.1A CN112769688B (en) 2020-12-18 2020-12-18 Method and device for protocol stack adaptation, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011513741.1A CN112769688B (en) 2020-12-18 2020-12-18 Method and device for protocol stack adaptation, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112769688A CN112769688A (en) 2021-05-07
CN112769688B true CN112769688B (en) 2022-07-29

Family

ID=75694344

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011513741.1A Active CN112769688B (en) 2020-12-18 2020-12-18 Method and device for protocol stack adaptation, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112769688B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114356804A (en) * 2021-12-28 2022-04-15 北京奕斯伟计算技术有限公司 Communication method, apparatus, device, computer-readable storage medium, and program product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102055638A (en) * 2009-11-06 2011-05-11 联想(北京)有限公司 Network seamless handover device and system and computer terminal
CN102780613A (en) * 2012-06-19 2012-11-14 瑞斯康达科技发展股份有限公司 Method and device for communication of boards of distributed device
CN103888441A (en) * 2014-01-03 2014-06-25 北京太一星晨信息技术有限公司 Information transmitting method between application and protocol stack and processing device
CN108712459A (en) * 2018-03-30 2018-10-26 深圳市风云实业有限公司 Protocol massages cross-layer communication method, device and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8019855B2 (en) * 2004-12-22 2011-09-13 Lg Electronics Inc. Method and apparatus interfacing between an application and a library of a master for network managing
CN101150488B (en) * 2007-11-15 2012-01-25 曙光信息产业(北京)有限公司 A receiving method for zero copy network packet
US8763018B2 (en) * 2011-08-22 2014-06-24 Solarflare Communications, Inc. Modifying application behaviour
CN115022981A (en) * 2019-02-15 2022-09-06 华为技术有限公司 Method and device for establishing bearing and readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102055638A (en) * 2009-11-06 2011-05-11 联想(北京)有限公司 Network seamless handover device and system and computer terminal
CN102780613A (en) * 2012-06-19 2012-11-14 瑞斯康达科技发展股份有限公司 Method and device for communication of boards of distributed device
CN103888441A (en) * 2014-01-03 2014-06-25 北京太一星晨信息技术有限公司 Information transmitting method between application and protocol stack and processing device
CN108712459A (en) * 2018-03-30 2018-10-26 深圳市风云实业有限公司 Protocol massages cross-layer communication method, device and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
改进的网络控制系统安全保障技术方案;李伟河等;《数字技术与应用》;20101015(第10期);全文 *

Also Published As

Publication number Publication date
CN112769688A (en) 2021-05-07

Similar Documents

Publication Publication Date Title
CN111800462B (en) Micro service instance processing method, micro service instance processing device, computer equipment and storage medium
CN110471746B (en) Distributed transaction callback method, device and system
US11853767B2 (en) Inter-core data processing method, system on chip and electronic device
CN112783506B (en) Model operation method and related device
CN104123265A (en) Method and system for communication among multiple kernels
CN112769688B (en) Method and device for protocol stack adaptation, electronic equipment and storage medium
CN106603125B (en) Method and device for data interaction with Bluetooth equipment
CN205541170U (en) MPOS machine and mobile payment system
CN111324326B (en) Processing method and device for displaying software to one machine with multiple screens
CN110764905B (en) Network model generation method and device, computer equipment and storage medium
CN111475230A (en) Application function configuration method and device and electronic equipment
CN114138363A (en) Program data calling method, device, equipment and storage medium
CN114422236A (en) Intelligent device access method and device and electronic device
CN114254278A (en) User account merging method and device, computer equipment and storage medium
CN108121580A (en) The implementation method and device of application notification service
CN108809763B (en) Network performance parameter acquisition method, terminal device and storage medium
CN111667411A (en) Image transmission method and device, electronic equipment and storage medium
CN116048490B (en) Business event processing method, device, computer equipment and storage medium
CN114268653B (en) Equipment calling method, device, equipment, medium and product
CN115543343B (en) Variable cross-thread operation method and device
CN117667141A (en) Charging protocol software system and multiparty cooperative processing method
CN111200861B (en) Method and device for searching wireless communication network in terminal
CN112000462A (en) Data processing method and device based on shared peripheral resources
CN117009058A (en) Data processing method, device, computer equipment and storage medium
CN115277828A (en) Registration method and device of intelligent equipment and electronic equipment

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
GR01 Patent grant
GR01 Patent grant