CN115208960B - Protocol switching method and related equipment - Google Patents

Protocol switching method and related equipment Download PDF

Info

Publication number
CN115208960B
CN115208960B CN202210701856.6A CN202210701856A CN115208960B CN 115208960 B CN115208960 B CN 115208960B CN 202210701856 A CN202210701856 A CN 202210701856A CN 115208960 B CN115208960 B CN 115208960B
Authority
CN
China
Prior art keywords
protocol
interface
information
target
plug
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
CN202210701856.6A
Other languages
Chinese (zh)
Other versions
CN115208960A (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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202210701856.6A priority Critical patent/CN115208960B/en
Publication of CN115208960A publication Critical patent/CN115208960A/en
Application granted granted Critical
Publication of CN115208960B publication Critical patent/CN115208960B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

The embodiment of the application provides a protocol switching method and related equipment. The protocol switching method comprises the following steps: acquiring current scene information, first interface information and second interface information; performing protocol screening processing based on the current scene information, the first interface information and the second interface information to obtain a protocol mark of a target protocol, wherein the target protocol is a protocol which needs to be switched by the second interface; inquiring a corresponding target plug-in through a serial peripheral interface according to the protocol mark, wherein the target plug-in comprises a target protocol; and loading the target plug-in to switch to the target protocol. The embodiment of the application can improve the efficiency of protocol switching in the migration process, and the switched target protocol is more suitable. Meanwhile, when the protocol is switched, the protocol plug-in is inquired through the serial peripheral interface, and the protocol is switched through the mode of loading the protocol plug-in, so that the process of editing and writing a download protocol is omitted, the plug-in switching efficiency can be further improved, and the noninductive switching is realized.

Description

Protocol switching method and related equipment
Technical Field
The present application relates to the field of computer and communication technologies, and in particular, to a protocol switching method and related devices.
Background
Currently, in the internet field, many systems need to be updated and iterated continuously, so that the problem of new and old functions or new and old interface migration is solved. In the migration process, a great deal of differences exist between new and old interfaces, especially in terms of message addresses and the like, which requires frequent protocol switching in the migration process.
However, the protocol switching in the current migration process is basically completed by manual operation, so that the switching process is tedious and time-consuming, and the switched protocol is not necessarily suitable for the running environment.
Disclosure of Invention
The embodiment of the application provides a protocol switching method and related equipment, which can further improve the efficiency of protocol switching in the migration process at least to a certain extent and switch to a more proper protocol.
Other features and advantages of the application will be apparent from the following detailed description, or may be learned by the practice of the application.
According to an aspect of an embodiment of the present application, there is provided a protocol switching method, including:
acquiring current scene information, first interface information and second interface information;
performing protocol screening processing based on the current scene information, the first interface information and the second interface information to obtain a protocol mark of a target protocol, wherein the target protocol is a protocol which needs to be switched by the second interface;
inquiring a corresponding target plug-in through a serial peripheral interface according to the protocol mark, wherein the target plug-in comprises a target protocol;
and loading the target plug-in to switch to the target protocol.
In one embodiment of the present application, the protocol filtering process is performed based on the current scene information, the first interface information and the second interface information to obtain a protocol flag of the target protocol, and the method may further include:
and carrying out table lookup based on the current scene information, the first interface information and the second interface information to obtain a protocol mark of a target protocol.
In one embodiment of the present application, a protocol filtering process is performed based on the current scene information, the first interface information, and the second interface information to obtain a protocol flag of a target protocol, including:
and inputting the current scene information, the first interface information and the second interface information into a protocol screening model, and outputting a protocol mark of a target protocol by the protocol screening model.
In one embodiment of the present application, the current scenario information includes a current data stream format, a current data address, a current data stream packet and current running environment information, the first interface information includes an interface address and an interface packet of a first interface, the second interface information includes an interface address and an interface packet of a second interface, the current scenario information, the first interface information and the second interface information are input into a protocol filtering model, and the protocol filtering model outputs a protocol flag of a target protocol, and the method specifically includes:
preprocessing the current scene information, the first interface information and the second interface information to obtain a message information vector and an address information vector, wherein the message information vector comprises a plurality of information dimensions which respectively represent a current data message, an interface message of a first interface and an interface message of a second interface, and the address information vector comprises a plurality of information dimensions which respectively represent an interface address of the first interface and an interface address of the second interface of the current data address;
determining a target protocol vector according to a current data stream format, a current data address, a current data stream message and current operation environment information, wherein the target protocol vector comprises a plurality of information dimensions which respectively represent all protocols applicable to the current data stream;
and inputting the target protocol vector, the message information vector and the address information vector into the protocol screening model, and outputting a protocol mark of the target protocol by the protocol screening model.
In one embodiment of the present application, the training method of the protocol screening model specifically includes:
obtaining a screening vector sample set, wherein each screening vector sample comprises a target protocol vector, a message information vector and an address information vector, and each screening vector sample is marked with a corresponding protocol mark in advance;
respectively inputting the data of each screening vector sample into a protocol screening model to obtain a protocol mark of the screening output;
if the protocol mark obtained after the data of the screening vector sample is input into the protocol screening model is inconsistent with the protocol mark calibrated in advance for the screening vector sample, the coefficient of the protocol screening model is adjusted until the protocol mark is consistent with the protocol mark;
and after all the data of the screening vector samples are input into a protocol screening model, the obtained protocol mark is consistent with the protocol mark calibrated in advance for the screening vector samples, and training is finished.
In one embodiment of the present application, the querying, according to the protocol flag, the corresponding target plugin through the serial peripheral interface specifically includes:
inquiring a corresponding protocol from a plug-in library through a serial peripheral interface according to the protocol mark;
if the plug-in library has plug-ins corresponding to the protocol marks, obtaining the plug-ins and taking the plug-ins as target plug-ins;
and if the plug-in library does not have a plug-in corresponding to the protocol mark, sending a reminding message so as to expand and write a target plug-in based on the reminding message.
In one embodiment of the present application, after the protocol filtering process is performed based on the current scene information, the first interface information, and the second interface information, the protocol switching method further includes:
acquiring attribute names input by a user;
and acquiring a protocol plug-in corresponding to the attribute name as the target plug-in.
According to an aspect of an embodiment of the present application, there is provided a protocol switching apparatus including:
the information acquisition module is used for acquiring current scene information, first interface information and second interface information;
the mark acquisition module is used for carrying out protocol screening processing based on the current scene information, the first interface information and the second interface information to obtain a protocol mark of a target protocol, wherein the target protocol is a protocol which needs to be switched by the second interface;
the plug-in query module is used for querying a corresponding target plug-in through a serial peripheral interface according to the protocol mark, wherein the target plug-in comprises a target protocol;
and the plug-in loading module is used for loading the target plug-in so as to switch to the target protocol.
According to an aspect of the embodiments of the present application, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a protocol switching method as described in the above embodiments.
According to an aspect of an embodiment of the present application, there is provided an electronic apparatus including: one or more processors; and a storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the protocol switching method as described in the above embodiments.
In the technical solutions provided in some embodiments of the present application, by performing protocol screening according to the current scene information, the first interface information, and the second interface information, a protocol that accords with both an operating environment and an interface protocol is selected as a target to be loaded, so that efficiency of protocol switching in a migration process is improved, and a switched target protocol is more suitable. Meanwhile, when the protocol is switched, the protocol plug-in is inquired through the serial peripheral interface, and the protocol is switched through the mode of loading the protocol plug-in, so that the process of editing and writing a download protocol is omitted, the plug-in switching efficiency can be further improved, and the noninductive switching is realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is evident that the drawings in the following description are only some embodiments of the present application and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art. In the drawings:
FIG. 1 shows a schematic diagram of an exemplary system architecture to which the technical solution of an embodiment of the application may be applied;
fig. 2 schematically shows a flow chart of a protocol switching method according to an embodiment of the application.
Fig. 3 is a flowchart of a specific implementation of step S200 in the protocol switching method according to the corresponding embodiment of fig. 2.
Fig. 4 is a flowchart of a specific implementation of step S300 in the protocol switching method according to the corresponding embodiment of fig. 2.
Fig. 5 schematically shows a block diagram of a protocol switching apparatus according to an embodiment of the application.
Fig. 6 shows the structure of a computer system suitable for use in implementing the electronic device of the embodiment of the application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the application may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which the technical solution of an embodiment of the present application may be applied.
As shown in fig. 1, the system architecture may include a terminal device (such as one or more of the smartphone 101, tablet 102, and portable computer 103 shown in fig. 1, but of course, a desktop computer, etc.), a network 104, and a server 105. The network 104 is the medium used to provide communication links between the terminal devices and the server 105. The network 104 may include various connection types, such as wired communication links, wireless communication links, and the like.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, the server 105 may be a server cluster formed by a plurality of servers.
A user may interact with the server 105 via the network 104 using a terminal device to receive or send messages or the like. The server 105 may be a server providing various services. For example, the user uploads the current scene information, the first interface information and the second interface information to the server 105 by using the terminal device 103 (may also be the terminal device 101 or 102), and the server 105 may perform a protocol filtering process based on the current scene information, the first interface information and the second interface information to obtain a protocol flag of a target protocol, where the target protocol is a protocol that needs to be switched by the second interface; inquiring a corresponding target plug-in through a serial peripheral interface according to the protocol mark, wherein the target plug-in comprises a target protocol; and loading the target plug-in to switch to the target protocol.
It should be noted that, the protocol switching method provided in the embodiment of the present application is generally executed by the server 105, and accordingly, the protocol switching device is generally disposed in the server 105. However, in other embodiments of the present application, the terminal device may also have a similar function as the server, so as to execute the protocol switching scheme provided by the embodiments of the present application.
The implementation details of the technical scheme of the embodiment of the application are described in detail below:
fig. 2 shows a flow chart of a protocol switching method according to an embodiment of the present application, which may be performed by a server, which may be the server shown in fig. 1.
Referring to fig. 2, the protocol switching method at least includes:
step S100, current scene information, first interface information and second interface information are obtained;
step S200, carrying out protocol screening processing based on the current scene information, the first interface information and the second interface information to obtain a protocol mark of a target protocol, wherein the target protocol is a protocol which needs to be switched by the second interface;
step S300, inquiring a corresponding target plug-in through a serial peripheral interface according to the protocol mark, wherein the target plug-in comprises a target protocol;
step S400, loading the target plugin to switch to the target protocol.
In the embodiment of the application, current scene information, first interface information and second interface information are acquired firstly, then protocol screening processing is carried out based on the current scene information, the first interface information and the second interface information, and a protocol mark of a target protocol is obtained, wherein the target protocol is a protocol which needs to be switched by the second interface; inquiring a corresponding target plug-in through a serial peripheral interface according to the protocol mark, wherein the target plug-in comprises a target protocol; and finally, loading the target plug-in to switch to the target protocol.
According to the embodiment of the application, the protocol screening is carried out according to the current scene information, the first interface information and the second interface information, and the protocol which accords with the running environment and the interface protocol is selected as the target to be loaded, so that the efficiency of protocol switching in the migration process is improved, and the switched target protocol is more suitable. Meanwhile, when the protocol is switched, the protocol plug-in is inquired through the serial peripheral interface, and the protocol is switched through the mode of loading the protocol plug-in, so that the process of editing and writing a download protocol is omitted, the plug-in switching efficiency can be further improved, and the noninductive switching is realized.
The manner of acquiring the current scene information in step S100 may be real-time acquisition by sending a query instruction to the server in real time or real-time acquisition by a real-time monitoring module in the server, and the manner of acquiring the first interface information and the second interface information may be acquisition by sending a call instruction or a query instruction. The current context information refers to some formatted information related to the current operating environment, operating data, for example, including, in some embodiments, the current data stream format, the current data address, the current data stream message, and the current operating environment information. The first interface information refers to some formatted information associated with the first interface, e.g., in some embodiments, it includes an interface address and an interface message of the first interface, and the second interface information refers to some formatted information associated with the second interface, e.g., in some embodiments, it includes an interface address and an interface message of the second interface.
In step S200, according to the current scene information, the first interface information and the second interface information, a protocol is screened, and a protocol which accords with the running environment and the interface protocol can be selected as a target to be loaded, so that the efficiency of protocol switching in the migration process is improved, and the switched target protocol is more suitable.
Specifically, the step S200 is performed by a table look-up method, a model method, or the like.
The step of performing the table lookup method may be performing table lookup based on the current scene information, the first interface information, and the second interface information, so as to obtain a protocol flag of the target protocol.
In the table lookup method, one or a plurality of tables may be searched.
When the searched table is one, table lookup is performed based on the current scene information, the first interface information and the second interface information, and the specific implementation step of obtaining the protocol mark of the target protocol may be that the main key item and the table head item of the table are traversed to search out the main key item and the table head item which are matched with the current scene information, the first interface information and the second interface information, and the corresponding protocol is the target protocol, so as to obtain the corresponding protocol mark.
When the number of the searched tables is multiple, table lookup is performed based on the current scene information, the first interface information and the second interface information, and the specific implementation step of obtaining the protocol mark of the target protocol may be that the protocol suitable for the current scene is determined according to the current scene information, then the protocol suitable for the interface is determined according to the first interface information and the second interface information, then the target protocol is determined based on the protocol suitable for the current scene and the protocol suitable for the interface, and the corresponding protocol mark is obtained.
The step of executing the modeling method may be to input the current scene information, the first interface information, and the second interface information into a protocol filtering model, and the protocol filtering model outputs a protocol flag of a target protocol.
Specifically, in some embodiments, a specific implementation of step S200 may refer to fig. 3. Fig. 3 is a detailed description of step S200 in the protocol switching method according to the corresponding embodiment of fig. 2, where the current scenario information includes a current data stream format, a current data address, a current data stream packet, and current running environment information, the first interface information includes an interface address and an interface packet of the first interface, and the second interface information includes an interface address and an interface packet of the second interface, and step S200 may include the following steps:
step S210, preprocessing the current scene information, the first interface information and the second interface information to obtain a message information vector and an address information vector, wherein the message information vector comprises a plurality of information dimensions which respectively represent a current data message, an interface message of a first interface and an interface message of a second interface, and the address information vector comprises a plurality of information dimensions which respectively represent an interface address of the first interface and an interface address of the second interface of the current data address;
step S220, determining a target protocol vector according to a current data stream format, a current data address, a current data stream message and current operation environment information, wherein the target protocol vector comprises a plurality of information dimensions which respectively represent all protocols applicable to the current data stream;
step S230, inputting the target protocol vector, the message information vector and the address information vector into the protocol filtering model, and outputting the protocol flag of the target protocol by the protocol filtering model.
In this embodiment, the current scene information, the first interface information and the second interface information are preprocessed to obtain a message information vector and an address information vector. And performing preliminary screening through current scene information such as a current data stream format, a current data address, a current data stream message, current running environment information and the like to obtain all protocols suitable for the current data stream, and integrating all applicable protocols into one vector to generate a target protocol vector. And finally, inputting the target protocol vector, the message information vector and the address information vector into the protocol screening model, finally selecting the most suitable protocol through the protocol screening model, and outputting a protocol mark of the most suitable protocol as a protocol mark of the target protocol. The embodiment limits the screening range through preliminary screening pretreatment, reduces the probability of outputting error protocols by the protocol screening model, shortens the training time of the protocol screening model, and improves the accuracy of the protocol screening model.
In this embodiment, the step S210 and the step S220 may be performed synchronously or asynchronously, and the execution sequence is not required, so long as the step S230 is preceded.
The training method of the protocol screening model specifically comprises the following steps:
obtaining a screening vector sample set, wherein each screening vector sample comprises a target protocol vector, a message information vector and an address information vector, and each screening vector sample is marked with a corresponding protocol mark in advance;
respectively inputting the data of each screening vector sample into a protocol screening model to obtain a protocol mark of the screening output;
if the protocol mark obtained after the data of the screening vector sample is input into the protocol screening model is inconsistent with the protocol mark calibrated in advance for the screening vector sample, the coefficient of the protocol screening model is adjusted until the protocol mark is consistent with the protocol mark;
and after all the data of the screening vector samples are input into a protocol screening model, the obtained protocol mark is consistent with the protocol mark calibrated in advance for the screening vector samples, and training is finished.
In step S300, the calling and obtaining of each protocol are completed through the serial peripheral interface and the plug-in, in this embodiment, each protocol is respectively encapsulated in different plug-ins, and when the calling is required, the calling is performed through the serial peripheral interface according to the protocol mark thereof, so as to realize the dynamic plug-in, and the user is free from feeling to use.
Specifically, in some embodiments, the specific implementation of step S300 may refer to fig. 4. Fig. 4 is a detailed description of step S300 in the protocol switching method according to the corresponding embodiment of fig. 2, where step S300 may include the following steps:
step S310, inquiring a corresponding protocol from a plug-in library through a serial peripheral interface according to the protocol mark;
step S320, if the plug-in library has plug-ins corresponding to the protocol marks, obtaining the plug-ins and taking the plug-ins as target plug-ins;
and step S330, if the plug-in library does not have a plug-in corresponding to the protocol mark, a reminding message is sent so as to expand and write a target plug-in based on the reminding message.
In this embodiment, when the plug-in library is queried through the serial peripheral interface, if there is a plug-in the plug-in library, the corresponding plug-in can be directly used, but if there is no corresponding plug-in the plug-in library, the writing of the protocol plug-in is required to be performed so that the interface can have a protocol used.
In step S330, when the corresponding plugin cannot be queried in the plugin library, a reminder message is sent to remind the extension writing of the plugin, so as to obtain the plugin containing the applicable target protocol. Specifically, the reminding message may be a brief message containing the name of the target protocol, or may be a pop-up editable text box, on which the name, address, message and other format information of the target protocol are recorded, and the reminder message acts as a reference for extension writing. After the protocol plug-in is written, the protocol plug-in is stored into a plug-in library through a serial peripheral interface so as to realize subsequent plug-and-play and realize the noninductive use of the protocol.
In step S400, after the target plug-in is acquired, the target plug-in may be directly loaded, and the target protocol is switched to after the loading is completed. According to the embodiment of the application, the protocol is packaged into the plug-in, and the plug-in is directly called when the protocol needs to be called, so that the time for searching the protocol file and deploying the protocol file is shortened, and the efficiency of protocol switching is further improved.
In some embodiments of the application, after step S300, the method further comprises:
acquiring attribute names input by a user;
and acquiring a protocol plug-in corresponding to the attribute name as the target plug-in.
In this embodiment, the user may further specify a target protocol, specifically, input an attribute name, and locate a corresponding protocol plug-in through the attribute name as the target plug-in.
Because the embodiment of the application converts the protocol plug-in, a user can acquire the corresponding protocol plug-in only by inputting the corresponding attribute name, and the instant noninductive protocol switching is realized through the protocol plug-in.
Meanwhile, the operation of protocol assignment by inputting the attribute name by the user can complement the automatic protocol screening in step S200, the target protocol selected in step S200 is not necessarily the protocol currently required by the user, for example, in some development stages, the user needs to perform a test in some assigned protocol environments, but the protocol environments are not necessarily the most suitable for the current scenario, and at this time, the protocol selected in step S200 is not the protocol desired by the user. At this time, the user can switch the protocol environment back to the desired protocol through the input of the attribute name, so as to realize the noninductive switching of the protocol.
Fig. 5 shows a block diagram of a protocol switching device according to an embodiment of the application.
Referring to fig. 5, a protocol switching apparatus 500 according to an embodiment of the present application includes:
an information obtaining module 510, configured to obtain current scene information, first interface information, and second interface information;
the flag obtaining module 520 is configured to perform a protocol screening process based on the current scene information, the first interface information, and the second interface information, to obtain a protocol flag of a target protocol, where the target protocol is a protocol that the second interface needs to be switched;
the plug-in query module 530 is configured to query, according to the protocol flag, a corresponding target plug-in through a serial peripheral interface, where the target plug-in includes a target protocol;
and a plug-in loading module 540, configured to load the target plug-in to switch to the target protocol.
Fig. 6 shows a schematic diagram of a computer system suitable for use in implementing an embodiment of the application.
It should be noted that, the computer system of the electronic device shown in fig. 6 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 6, the computer system includes a central processing unit (Central Processing Unit, CPU) 1801, which can perform various appropriate actions and processes, such as performing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 1802 or a program loaded from a storage section 1808 into a random access Memory (Random Access Memory, RAM) 1803. In the RAM 1803, various programs and data required for system operation are also stored. The CPU 1801, ROM 1802, and RAM 1803 are connected to each other via a bus 1804. An Input/Output (I/O) interface 1805 is also connected to the bus 1804.
The following components are connected to the I/O interface 1805: an input section 1806 including a keyboard, a mouse, and the like; an output portion 1807 including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and a speaker, etc.; a storage section 1808 including a hard disk or the like; and a communication section 1809 including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section 1809 performs communication processing via a network such as the internet. The drive 1810 is also connected to the I/O interface 1805 as needed. Removable media 1811, such as magnetic disks, optical disks, magneto-optical disks, semiconductor memory, and the like, is installed as needed on drive 1810 so that a computer program read therefrom is installed as needed into storage portion 1808.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method shown in the flowchart. In such embodiments, the computer program may be downloaded and installed from a network via the communication portion 1809, and/or installed from the removable medium 1811. When executed by a Central Processing Unit (CPU) 1801, performs various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), flash Memory, an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with a computer-readable computer program embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Where each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; or may exist alone without being incorporated into the electronic device. The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to implement the methods described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the method according to the embodiments of the present application.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A method for switching protocols, comprising:
acquiring current scene information, first interface information and second interface information;
performing protocol screening processing based on the current scene information, the first interface information and the second interface information to obtain a protocol mark of a target protocol, wherein the target protocol is a protocol which needs to be switched by the second interface;
inquiring a corresponding target plug-in through a serial peripheral interface according to the protocol mark, wherein the target plug-in comprises a target protocol;
and loading the target plug-in to switch to the target protocol.
2. The protocol switching method according to claim 1, wherein performing a protocol filtering process based on the current scene information, the first interface information, and the second interface information to obtain a protocol flag of a target protocol includes:
and carrying out table lookup based on the current scene information, the first interface information and the second interface information to obtain a protocol mark of a target protocol.
3. The protocol switching method according to claim 1, wherein performing a protocol filtering process based on the current scene information, the first interface information, and the second interface information to obtain a protocol flag of a target protocol includes:
and inputting the current scene information, the first interface information and the second interface information into a protocol screening model, and outputting a protocol mark of a target protocol by the protocol screening model.
4. The protocol switching method according to claim 3, wherein the current scenario information includes a current data stream format, a current data address, a current data stream packet, and current operating environment information, the first interface information includes an interface address and an interface packet of a first interface, the second interface information includes an interface address and an interface packet of a second interface, the current scenario information, the first interface information, and the second interface information are input into a protocol filtering model, and the protocol filtering model outputs a protocol flag of a target protocol, specifically including:
preprocessing the current scene information, the first interface information and the second interface information to obtain a message information vector and an address information vector, wherein the message information vector comprises a plurality of information dimensions which respectively represent a current data message, an interface message of a first interface and an interface message of a second interface, and the address information vector comprises a plurality of information dimensions which respectively represent an interface address of the first interface and an interface address of the second interface of the current data address;
determining a target protocol vector according to a current data stream format, a current data address, a current data stream message and current operation environment information, wherein the target protocol vector comprises a plurality of information dimensions which respectively represent all protocols applicable to the current data stream;
and inputting the target protocol vector, the message information vector and the address information vector into the protocol screening model, and outputting a protocol mark of the target protocol by the protocol screening model.
5. The protocol switching method as claimed in claim 4, wherein the training method of the protocol screening model specifically comprises:
obtaining a screening vector sample set, wherein each screening vector sample comprises a target protocol vector, a message information vector and an address information vector, and each screening vector sample is marked with a corresponding protocol mark in advance;
respectively inputting the data of each screening vector sample into a protocol screening model to obtain a protocol mark of the screening output;
if the protocol mark obtained after the data of the screening vector sample is input into the protocol screening model is inconsistent with the protocol mark calibrated in advance for the screening vector sample, the coefficient of the protocol screening model is adjusted until the protocol mark is consistent with the protocol mark;
and after all the data of the screening vector samples are input into a protocol screening model, the obtained protocol mark is consistent with the protocol mark calibrated in advance for the screening vector samples, and training is finished.
6. The protocol switching method according to claim 1, wherein the querying the corresponding target plugin through the serial peripheral interface according to the protocol flag specifically includes:
inquiring a corresponding protocol from a plug-in library through a serial peripheral interface according to the protocol mark;
if the plug-in library has plug-ins corresponding to the protocol marks, obtaining the plug-ins and taking the plug-ins as target plug-ins;
and if the plug-in library does not have a plug-in corresponding to the protocol mark, sending a reminding message so as to expand and write a target plug-in based on the reminding message.
7. The protocol switching method according to claim 1, wherein after the protocol filtering process is performed based on the current scene information, the first interface information, and the second interface information, a protocol flag of a target protocol is obtained, the protocol switching method further comprises:
acquiring attribute names input by a user;
and acquiring a protocol plug-in corresponding to the attribute name as the target plug-in.
8. A protocol switching device, the protocol switching device comprising:
the information acquisition module is used for acquiring current scene information, first interface information and second interface information;
the mark acquisition module is used for carrying out protocol screening processing based on the current scene information, the first interface information and the second interface information to obtain a protocol mark of a target protocol, wherein the target protocol is a protocol which needs to be switched by the second interface;
the plug-in query module is used for querying a corresponding target plug-in through a serial peripheral interface according to the protocol mark, wherein the target plug-in comprises a target protocol;
and the plug-in loading module is used for loading the target plug-in so as to switch to the target protocol.
9. A computer readable medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the protocol switching method according to any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the protocol switching method of any of claims 1 to 7.
CN202210701856.6A 2022-06-20 2022-06-20 Protocol switching method and related equipment Active CN115208960B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210701856.6A CN115208960B (en) 2022-06-20 2022-06-20 Protocol switching method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210701856.6A CN115208960B (en) 2022-06-20 2022-06-20 Protocol switching method and related equipment

Publications (2)

Publication Number Publication Date
CN115208960A CN115208960A (en) 2022-10-18
CN115208960B true CN115208960B (en) 2023-08-18

Family

ID=83575822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210701856.6A Active CN115208960B (en) 2022-06-20 2022-06-20 Protocol switching method and related equipment

Country Status (1)

Country Link
CN (1) CN115208960B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857569A (en) * 2018-11-08 2019-06-07 深圳壹账通智能科技有限公司 Interface calling processing method and device, storage medium, computer equipment
CN112532564A (en) * 2019-09-17 2021-03-19 中国移动通信集团广东有限公司 Service calling method and device and electronic equipment
CN112751812A (en) * 2019-10-31 2021-05-04 北京京东振世信息技术有限公司 Method and device for self-adapting application protocol

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8719480B2 (en) * 2011-11-30 2014-05-06 International Business Machines Corporation Automated network configuration in a dynamic virtual environment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857569A (en) * 2018-11-08 2019-06-07 深圳壹账通智能科技有限公司 Interface calling processing method and device, storage medium, computer equipment
CN112532564A (en) * 2019-09-17 2021-03-19 中国移动通信集团广东有限公司 Service calling method and device and electronic equipment
CN112751812A (en) * 2019-10-31 2021-05-04 北京京东振世信息技术有限公司 Method and device for self-adapting application protocol

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
多接口协议转换器的设计与实现;张科;张红娟;;信息化研究(第07期);全文 *

Also Published As

Publication number Publication date
CN115208960A (en) 2022-10-18

Similar Documents

Publication Publication Date Title
CN109062563B (en) Method and device for generating page
CN111414743A (en) Method and device for calling document template, electronic equipment and storage medium
CN109815448B (en) Slide generation method and device
CN112395253A (en) Index file generation method, terminal device, electronic device and medium
CN111460232A (en) Functional module searching method, device, terminal and computer readable storage medium
CN112988583A (en) Method and device for testing syntax compatibility of database
CN115794641A (en) Method, device and equipment for making number based on business process and storage medium
CN111641690B (en) Session message processing method and device and electronic equipment
CN115208960B (en) Protocol switching method and related equipment
CN111813685A (en) Automatic testing method and device
CN111124541A (en) Configuration file generation method, device, equipment and medium
CN108196921B (en) Document development method and device, computer equipment and storage medium
CN111142990A (en) WeChat applet page display method and device and storage medium
CN116048609A (en) Configuration file updating method, device, computer equipment and storage medium
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN115495658A (en) Data processing method and device
CN114338846B (en) Message testing method and device
CN115017110A (en) Information processing method, device, terminal and storage medium
CN115114321A (en) Dynamic query method and system
CN114239501A (en) Contract generation method, apparatus, device and medium
CN115756452A (en) Target page code generation method, device, storage medium and program product
CN113377648A (en) Software system diagnosis method and device, electronic equipment and computer readable medium
CN112115154A (en) Data processing and data query method, device, equipment and computer readable medium
CN110968334A (en) Application resource updating method, resource package manufacturing method, device, medium and equipment
CN110543243A (en) Data processing method, device, equipment and storage medium

Legal Events

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