Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a method, a device, a communication system, computer equipment and a storage medium for communication between a server and a client.
The present invention provides a method for a server to communicate with a client according to a first aspect, and in one embodiment, the method includes:
responding to a message sending instruction, and acquiring message content and client identity information corresponding to the message sending instruction;
determining the current configuration information of a communication protocol configuration item in a preset configuration file;
determining a communication module identifier corresponding to the current configuration information;
and determining a target communication module corresponding to the communication module identifier in a plurality of preset communication modules, and sending the message content and the client identity information to the target communication module, so that the target communication module sends the message content to a target client corresponding to the client identity information.
In one embodiment, before the step of obtaining, by the server, the message content and the client identity information corresponding to the message sending instruction in response to the message sending instruction, the method includes:
responding to a program starting instruction, and determining a service code corresponding to the program starting instruction;
scanning the service code, and determining a preset annotation identifier contained in the service code;
and updating the configuration information of the communication protocol configuration items in the preset configuration file according to the preset annotation mark.
In an embodiment, the step of updating, by the server, the configuration information of the communication protocol configuration item in the preset configuration file according to the preset annotation identifier includes:
determining a communication protocol identifier corresponding to the preset annotation identifier;
and updating the current configuration information of the communication protocol configuration item in the preset configuration file into the communication protocol identifier corresponding to the preset annotation identifier.
The present invention provides according to a second aspect a communication system, which in one embodiment comprises: the system comprises a first computing device and a plurality of second computing devices, wherein the first computing device comprises one or more server modules and a plurality of communication modules, communication protocols configured among the communication modules are different, each second computing device comprises a client module, and the communication protocols configured among the client modules of the second computing devices are different;
any one server module in the first computing device, configured to respond to a message sending instruction, obtain message content and client identity information corresponding to the message sending instruction, determine current configuration information of a communication protocol configuration item in a preset configuration file, determine a communication module identifier corresponding to the current configuration information, determine a target communication module corresponding to the communication module identifier among the plurality of communication modules, and send the message content and the client identity information to the target communication module;
any communication module in the first computing device is used for determining a target second computing device corresponding to the client identity information from the plurality of second computing devices when receiving the message content and the client identity information sent by any server module; the message content is sent to the target second computing device.
In one embodiment, before the step of obtaining, by any server module, the message content and the client identity information corresponding to the message sending instruction in response to the message sending instruction, the method includes:
responding to a program starting instruction, and determining a service code corresponding to the program starting instruction;
scanning the service code, and determining a preset annotation identifier contained in the service code;
and updating the configuration information of the communication protocol configuration items in the preset configuration file according to the preset annotation mark.
In an embodiment, the step of updating, by any server module, the configuration information of the communication protocol configuration item in the preset configuration file according to the preset annotation identifier includes:
determining a communication protocol identifier corresponding to the preset annotation identifier;
and updating the current configuration information of the communication protocol configuration item in the preset configuration file into the communication protocol identifier corresponding to the preset annotation identifier.
In an embodiment, the client module on the second computing device is configured to, when receiving a message upload instruction, obtain a message upload content and target server identity information corresponding to the message upload instruction, determine target communication module identity information corresponding to the target server identity information, and send the message upload content and the target server identity information to a communication module corresponding to the target communication module identity information in the first computing device, so that the communication module sends the message upload content to the server module corresponding to the target server identity information.
The present invention provides, according to a third aspect, an apparatus for a server to communicate with a client, in one embodiment, the apparatus includes:
the instruction corresponding information acquisition module is used for responding to the message sending instruction and acquiring the message content and the client identity information corresponding to the message sending instruction;
the configuration information determining module is used for determining the current configuration information of the communication protocol configuration item in the preset configuration file;
a module identification determining module for determining the communication module identification corresponding to the current configuration information;
and the information sending module is used for determining a target communication module corresponding to the communication module identifier in a plurality of preset communication modules configured with different communication protocols, and sending the message content and the client identity information to the target communication module so that the target communication module sends the message content to a target client corresponding to the client identity information.
The present invention provides according to a fourth aspect a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of an embodiment of any of the methods described above when executing the computer program.
The present invention provides according to a fifth aspect a computer readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of an embodiment of any of the methods described above.
In the embodiment of the invention, a server side responds to a message sending instruction, and obtains message content and client identity information corresponding to the message sending instruction; then determining the current configuration information of the communication protocol configuration items in the preset configuration file; determining a communication module identifier corresponding to the current configuration information; the method comprises the steps of determining a target communication module corresponding to a communication module identifier in a plurality of preset communication modules configured with different communication protocols, and sending message content and client identity information to the target communication module so that the target communication module sends the message content to a target client corresponding to the client identity information, wherein a plurality of communication modules configured with different communication protocols are preset in a communication layer in the embodiment, and a server can select which communication module is to be called to communicate with the client according to the configuration, namely, the embodiment can enable the clients adopting different communication protocols to share one server, so that services or service modules with similar logic among programs adopting different communication protocols can be extracted to be used as a single application, and simultaneously, the service is provided for each program, and developers do not need to repeatedly develop the programs with different communication protocols and similar logic or even share the same server Consistent business modules or services reduce the amount of code that needs to be written.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Fig. 1 is a diagram of a communication architecture between a server and a client at present, where the server and the client both configure the same communication protocol, and can be seen as two major service modules (including multiple services or services) and a communication module inside the server, and communication between the service modules and the client needs to be implemented through the communication module. It should be noted that, an existing communication framework usually has a communication protocol, and a service module developed based on the communication framework is coupled with a communication module, so if a server and a client of a program need to communicate using other communication protocols, the communication framework and the like on the bottom layer must be replaced, which is very troublesome to implement and has a large workload.
In addition, even if programs using different communication protocols need to use the same service or service, developers need to develop the same service or service separately, and there is no way to extract the same service or service to make a common independent service or independent service.
Therefore, an embodiment of the present invention provides a method for a server to communicate with a client.
The method is suitable for the application environment a (shown as 'a' in fig. 2) and the application environment b (shown as 'b' in fig. 2) which adopt a client-server (client-server) architecture as shown in fig. 2.
In the application environment a, a server 10 (hereinafter, referred to as a server) has a server program installed therein and has a server role, and a server 21, a server 22, and aserver 2N (hereinafter, referred to as a client server) each have a client program installed therein and have client roles. Theserver 10 can communicate with each client service, and it should be noted that the communication protocols used for the communication between each client server and theserver 10 are different, for example, the client server 21 communicates with theserver 10 using a TCP Protocol, the client server 22 communicates with theserver 10 using a UDP Protocol, and theclient server 2N communicates with theserver 10 using an HTTP (hypertext transfer Protocol) Protocol.
The architecture of the application scenario a in terms of communication is shown in fig. 3, a server program on theserver 10 includes a service module and a plurality of communication modules, and each communication module is preconfigured with different communication protocols, for example, a TCP communication module, an udp communication module, an http communication module, a websocket (a protocol for performing full-duplex communication on a single TCP connection) communication module, and the like. The service implementation and the communication implementation of the server program are mutually isolated, namely the service module and each communication module are decoupled. When a service module in a server program needs to communicate with a corresponding client program, a communication module which has the same communication protocol as the communication protocol configured by the client program is called, and communication with the client program can be realized through the communication module, so that one server program can communicate with the client programs configured with different communication protocols through a communication layer of which the communication module can be switched. Therefore, services or service modules with similar logics among the programs adopting different communication protocols can be extracted to be used as a single application, the single application is used as a server (namely server) and each program is used as a client (namely client), and the single application can simultaneously provide the same service for each program. For example, if the game program a is a role playing game based on the TCP protocol, it is necessary to develop a ranking list module, the game program B is a shooting game based on the UDP protocol, it is also necessary to develop a ranking list module logically identical to the ranking list module of the game program a, and then the developer only needs to develop a ranking list module, configure the ranking list module as a server, set the game program a and the game program B as clients, respectively, when the ranking list module needs to communicate with the game program A (which refers to the server where the game program is located), the ranking list module sends the relevant communication information to the game program A through the tcp communication module, and similarly, when the ranking list module needs to communicate with the B game program (here, the server where the game program is located), the ranking list module sends the relevant communication information to the B game program through the udp communication module.
Specifically, when the server program needs to change the communication protocol, the user (for example, a developer, an operation and maintenance person, or other person having authority to add the annotation identifier) only needs to add the annotation identifier corresponding to the communication protocol to be used in the program code, such as the class code and/or the method code in the class code, before the program code is started, the configuration file may be dynamically modified, so that the service module of the server program calls the communication module corresponding to the annotation identifier to communicate. It can be understood that if the client program to be communicated does not need to be re-developed, the communication protocol adopted by the client needs to be changed into the communication protocol subsequently adopted by the server. For example, if a certain role-playing game program using a TCP protocol is to be changed to a UDP protocol, the communication protocol used by the client program is changed to the UDP protocol, but the operation of changing the protocol of the server program only requires a developer (certainly, an operation and maintenance person, etc.) to add @ UDP server in front of the relevant code in the program code, so that the program can switch the communication module serving the service module from the TCP communication module to the UDP communication module when being started, and the role-playing game program can communicate with the client terminal using the UDP protocol.
It is understood that a communication module is used to support a communication protocol, and in different scenarios, the type and number of communication protocols to be used by the server program are different, and thus the number of communication modules included in the program and the respective supported communication protocols are also different. How many communication protocols are used by the server program, which communication protocols are supported are determined by developers according to specific scenes, which is not limited by the embodiment of the invention.
Further, as shown in fig. 4, in the communication aspect of the application scenario a, a plurality of server programs are installed on theserver 10, functions implemented by service modules included in the server programs are different from each other, however, the service modules of the server programs share one communication layer, for example, a game a using the TCP protocol and a game B using the UDP protocol share one ranking list module, a game C using the TCP protocol and a game D using the UDP protocol share one chat room module, and the ranking list module and the chat room module may be installed on the same server and share one communication layer. The communication layer comprises a plurality of communication modules with different communication protocols, and the service module in each server program can call the corresponding communication module when needing to communicate with the corresponding client program, so developers do not need to repeatedly develop service modules or services with similar or even consistent logics, and the code amount needing to be compiled is reduced. It can be understood that the communication protocol configured by the communication module called by the service module of any server program is the same as the communication protocol configured by the client program to be communicated by the service module. In addition, when any server program needs to switch the currently used communication protocol, the switching operation is also the operation of adding annotation identification corresponding to the communication protocol to be used later by the user in the program code related to communication, such as the class code and/or the method code in the class code.
It should be noted that "first", "second", and "N" in the first client, the second client, the first server, the second server, and the like shown in fig. 3 and fig. 4 refer to not the several clients and the several servers, but are used to identify the category of the communication protocol configured by the client. For example, if the "first" corresponding communication protocol is a TCP protocol, the "first server" refers to a server program configured with the TCP communication protocol, and the "first client" refers to a client program configured with the TCP communication protocol.
Further, in the application environment b, theserver 10 can communicate with a plurality of intelligent terminals (i.e. 31, 32, 3N shown in the figure) installed with different client programs. The intelligent terminal includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, desktop computers, and the like. In the application environment b, the details of the communication process between theserver 10 and the intelligent terminal are the same as those of the description of the application environment a, and are not described herein again.
Fig. 5 shows a method for a server to communicate with a client according to an embodiment of the present invention, which can be applied to the server 10 (hereinafter referred to as a server) in fig. 2.
The method comprises the following steps:
s110: and responding to the message sending instruction, and acquiring the message content and the client identity information corresponding to the message sending instruction.
In this embodiment, the message sending instruction refers to an instruction that the server needs to send a message to the client through the communication module after receiving the message. The message sending instruction may be an instruction which is issued by a user (such as a developer, an operation and maintenance worker, a tester, and the like) to the server and enables the server to send a message to the client, and since the server needs to feed back a request of the client after receiving the request, the message sending instruction may also be a request from the client or an instruction which is generated by the server itself and used for sending a message to the client. That is to say, when any server program on a server needs to send a message to a client corresponding to the server program (i.e., a client server or a terminal only on which the client program corresponding to the server program is installed), message content and client identity information corresponding to a received message sending instruction are determined first, where the message content refers to information that the server needs to send to the client, and the client identity information includes a client identifier, a client ip address, and port information corresponding to the client program on the client server or the intelligent terminal where the client program is located.
S120: and determining the current configuration information of the communication protocol configuration items in the preset configuration file.
In this embodiment, the preset configuration file includes information required by the server during operation, and the communication protocol configuration item in the configuration file is used to specify a communication protocol to be used by the server.
The communication protocol supported and used by the communication layer is corresponding to a unique communication protocol identifier, and the user configures the configuration information corresponding to the communication protocol configuration item in the configuration file into the communication protocol identifier of the communication protocol to be used by the user when the user wants to use what communication protocol to communicate. The communication layer has a plurality of communication modules which are configured with different communication protocols in advance, each communication module is pre-allocated with a communication module identifier for distinguishing different communication modules, and a mapping relation is pre-established by each communication protocol identifier and the corresponding communication module identifier, so that the corresponding communication module identifier can be determined by the communication protocol identifier configured on the communication protocol configuration item.
S130: and determining the communication module identification corresponding to the current configuration information.
In this embodiment, after the server determines the current configuration information, the server can determine the corresponding communication module identifier.
S140: determining a target communication module corresponding to the communication module identifier in a plurality of preset communication modules configured with different communication protocols, and sending the message content and the client identity information to the target communication module, so that the target communication module sends the message content to a target client corresponding to the client identity information.
In this embodiment, the server may be connected to a plurality of preset communication modules, the communication protocols configured on the plurality of communication modules are different, after the server determines the communication module identifier, only the received message content and the client identity information need to be sent to the communication module corresponding to the communication module identifier, that is, the target communication module, and the target communication module may automatically perform subsequent operations, that is, determine the client corresponding to the client identity information, then establish a communication connection with the client, and send the message content to the client through the communication connection.
In this embodiment, the communication layer is preset with a plurality of communication modules configured with different communication protocols, and the server can select to call a corresponding communication module to communicate with the client according to the configuration, that is, the clients adopting different communication protocols can share one server, so that services or service modules with similar logic between programs adopting different communication protocols can be extracted to serve as a single application, and simultaneously, services are provided for each program. For developers, business modules or services with similar or even consistent logic do not need to be repeatedly developed, and the code amount needing to be written is reduced.
In one embodiment, before the step of obtaining, by the server, the message content and the client identity information corresponding to the message sending instruction in response to the message sending instruction, the method includes:
responding to a program starting instruction, and determining a service code corresponding to the program starting instruction;
scanning the service code, and determining a preset annotation identifier contained in the service code;
and updating the configuration information of the communication protocol configuration items in the preset configuration file according to the preset annotation mark.
In this embodiment, when a developer writes a program in advance, the developer abstracts the communication mode or the communication function used by the program in the core module in the software project of the program in advance to obtain a plurality of communication modules, and needs to write a set of API (Application programming interface) for calling the communication modules, which is not related to the specific communication implementation. When a developer writes relevant codes of a business module subsequently, a statement comment (the statement comment refers to an annotation identifier, such as @ TcpServer and @ UdpServer) corresponding to the API can be added to the business method to declare the business method, it needs to be explained that the business method is completely unrelated to specific communication implementation, but the relevant codes of the business method can call the corresponding communication module through the API when running, so that the effect of decoupling the business code implementation and the communication implementation can be achieved.
Specifically, after the server receives a program start instruction, before or during the loading of the program code into the java virtual machine by the class loader, a relevant code of the business module, that is, a business code, is determined, and then the business code is scanned, for example, a code scanning tool may be used to scan whether a preset annotation identifier is added to the class code or the method code in the code, where the preset annotation identifier is an annotation identifier used for specifying a communication protocol to be used by the server, such as @ TcpServer, @ Tcp, and the like. And if the corresponding preset annotation identification is scanned, updating the corresponding configuration information according to the preset annotation identification.
Specifically, the step of updating, by the server, the configuration information of the communication protocol configuration item in the preset configuration file according to the preset annotation identifier includes:
determining a communication protocol identifier corresponding to the preset annotation identifier;
and updating the current configuration information of the communication protocol configuration item in the preset configuration file into the communication protocol identifier corresponding to the preset annotation identifier.
Each communication protocol identifier has its corresponding annotation identifier, for example, the annotation identifier corresponding to the TCP protocol is @ TcpServer, and the annotation identifier corresponding to the UDP protocol is @ UDP server. And determining the corresponding communication protocol identifier through the preset annotation identifier, and replacing the configuration information corresponding to the communication protocol configuration item in the preset configuration file with the communication protocol identifier corresponding to the preset annotation identifier.
In one embodiment, the present invention provides a device for a server to communicate with a client, as shown in fig. 6, including the following modules:
an instruction corresponding information obtaining module 110, configured to respond to a message sending instruction, and obtain message content and client identity information corresponding to the message sending instruction;
a configuration information determining module 120, configured to determine current configuration information of a communication protocol configuration item in a preset configuration file;
a module identifier determining module 130, configured to determine a communication module identifier corresponding to the current configuration information;
the information sending module 140 is configured to determine a target communication module corresponding to the communication module identifier among a plurality of preset communication modules configured with different communication protocols, and send the message content and the client identity information to the target communication module, so that the target communication module sends the message content to a target client corresponding to the client identity information.
In one embodiment, before the device for the server to communicate with the client performs the function corresponding to the instruction corresponding information acquiring module, the device further performs the functions corresponding to the following modules:
the service code determining module is used for responding to a program starting instruction and determining a service code corresponding to the program starting instruction;
the annotation identification determining module is used for scanning the business code and determining a preset annotation identification contained in the business code;
and the configuration information updating module is used for updating the configuration information of the communication protocol configuration items in the preset configuration file according to the preset annotation identifier.
In one embodiment, the configuration information update module includes:
the protocol identifier determining submodule is used for determining a communication protocol identifier corresponding to the preset annotation identifier;
and the configuration information updating submodule is used for updating the current configuration information of the communication protocol configuration item in the preset configuration file into the communication protocol identifier corresponding to the preset annotation identifier.
For specific limitations of the device for the server to communicate with the client, reference may be made to the above limitations of the method for the server to communicate with the client, which are not described herein again. All or part of each module in the device for the communication between the server and the client can be realized 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, the present invention also provides a communication system, comprising: the system comprises a first computing device and a plurality of second computing devices, wherein the first computing device comprises one or more server modules and a plurality of communication modules, communication protocols configured among the communication modules are different, each second computing device comprises a client module, and the communication protocols configured among the client modules of the second computing devices are different;
any one server module in the first computing device, configured to respond to a message sending instruction, obtain message content and client identity information corresponding to the message sending instruction, determine current configuration information of a communication protocol configuration item in a preset configuration file, determine a communication module identifier corresponding to the current configuration information, determine a target communication module corresponding to the communication module identifier among the plurality of communication modules, and send the message content and the client identity information to the target communication module;
any communication module in the first computing device is used for determining a target second computing device corresponding to the client identity information from the plurality of second computing devices when receiving the message content and the client identity information sent by any server; the message content is sent to the target second computing device.
Further, the client modules in the second computing devices are configured to receive message content sent by a certain communication module, and a communication protocol configured by the certain communication module is consistent with a communication protocol configured by each client module.
In this embodiment, if the first computing device in the communication system includes one server module, the server may select to invoke the corresponding communication module to communicate with the corresponding client module according to the configuration, that is, the client modules using different communication protocols can share one server module, if the first computing device in the communication system includes a plurality of server modules, each server module may share a plurality of communication modules in one communication layer, for example, a game a using a TCP protocol and a game B using a UDP protocol share one ranking list module, a game C using the TCP protocol and a game D using a UDP protocol share one chat room module, and the ranking list module and the chat room module may be installed on the same server and share one communication layer including a plurality of communication modules. For developers, business modules or services with similar or even consistent logic do not need to be repeatedly developed, and the code amount needing to be written is reduced.
In one embodiment, before the step of obtaining, by any server module, the message content and the client identity information corresponding to the message sending instruction in response to the message sending instruction, the method includes:
responding to a program starting instruction, and determining a service code corresponding to the program starting instruction;
scanning the service code, and determining a preset annotation identifier contained in the service code;
and updating the configuration information of the communication protocol configuration items in the preset configuration file according to the preset annotation mark.
In an embodiment, the step of updating, by any server module, the configuration information of the communication protocol configuration item in the preset configuration file according to the preset annotation identifier includes:
determining a communication protocol identifier corresponding to the preset annotation identifier;
and updating the current configuration information of the communication protocol configuration item in the preset configuration file into the communication protocol identifier corresponding to the preset annotation identifier.
In an embodiment, the client module in each second computing device is configured to determine, after receiving a message content sent by any one of the communication modules, server identity information corresponding to the message content and communication module identity information corresponding to the any one of the communication modules, and establish a mapping relationship between the server identity information and the communication module identity information.
In an embodiment, each of the client modules on the second computing devices is configured to, when receiving a message upload instruction, obtain a message upload content and target server identity information corresponding to the message upload instruction, determine target communication module identity information corresponding to the target server identity information, and send the message upload content and the target server identity information to a communication module corresponding to the target communication module identity information in the first computing device, so that the communication module sends the message upload content to the server module corresponding to the target server identity information.
For specific limitations of the communication system, reference may be made to the above method for the server to communicate with the client, and limitations of an application environment of the method, which are not described herein again.
In one embodiment, a computer device is provided, the internal structure of which may be as shown in FIG. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data such as configuration information. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method for a server to communicate with a client.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
responding to a message sending instruction, and acquiring message content and client identity information corresponding to the message sending instruction; determining the current configuration information of a communication protocol configuration item in a preset configuration file; determining a communication module identifier corresponding to the current configuration information; and determining a target communication module corresponding to the communication module identifier in a plurality of preset communication modules, and sending the message content and the client identity information to the target communication module, so that the target communication module sends the message content to a target client corresponding to the client identity information.
In one embodiment, the processor executes the computer program to realize the following steps before the step of obtaining the message content and the client identity information corresponding to the message sending instruction in response to the message sending instruction:
responding to a program starting instruction, and determining a service code corresponding to the program starting instruction; scanning the service code, and determining a preset annotation identifier contained in the service code; and updating the configuration information of the communication protocol configuration items in the preset configuration file according to the preset annotation mark.
In one embodiment, when the processor executes the computer program to implement the step of updating the configuration information of the communication protocol configuration item in the preset configuration file according to the preset annotation identifier, the following steps are further implemented:
determining a communication protocol identifier corresponding to the preset annotation identifier; and updating the current configuration information of the communication protocol configuration item in the preset configuration file into the communication protocol identifier corresponding to the preset annotation identifier.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
responding to a message sending instruction, and acquiring message content and client identity information corresponding to the message sending instruction; determining the current configuration information of a communication protocol configuration item in a preset configuration file; determining a communication module identifier corresponding to the current configuration information; and determining a target communication module corresponding to the communication module identifier in a plurality of preset communication modules, and sending the message content and the client identity information to the target communication module, so that the target communication module sends the message content to a target client corresponding to the client identity information.
In one embodiment, the computer program is executed by a processor, and before the step of obtaining the message content and the client identity information corresponding to the message sending instruction in response to the message sending instruction, the following steps are further implemented:
responding to a program starting instruction, and determining a service code corresponding to the program starting instruction; scanning the service code, and determining a preset annotation identifier contained in the service code; and updating the configuration information of the communication protocol configuration items in the preset configuration file according to the preset annotation mark.
In one embodiment, when the computer program is executed by the processor and updates the configuration information of the communication protocol configuration item in the preset configuration file according to the preset annotation identifier, the following steps are further implemented:
determining a communication protocol identifier corresponding to the preset annotation identifier; and updating the current configuration information of the communication protocol configuration item in the preset configuration file into the communication protocol identifier corresponding to the preset annotation identifier.
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, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
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.