Disclosure of Invention
The embodiment of the invention aims to provide a communication method, a communication system and a communication device, so as to realize data communication between a target browser and an instant messaging server and avoid communication service interruption.
The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a communication method, the method being applied to a target browser, the method comprising:
The method comprises the steps of receiving a call request for a target function module sent by an instant messaging server, wherein the call request comprises a first original function identifier of the target function module in a browser matched with a version of the instant messaging server;
Based on the corresponding relation between the original function identification of each function module and the mapping function identification of each function module in the target browser, which is recorded in the target application program interface API corresponding to the target browser, determining the mapping function identification corresponding to the first original function identification as the target function identification of the target function module in the target browser;
Invoking the target function module according to the target function identifier to obtain a first target resource;
And sending the first target resource to the instant messaging server.
Optionally, before the receiving the call request for the target function module sent by the instant messaging server, the method further includes:
The method comprises the steps of sending a connection request to the instant messaging server so that the instant messaging server sends a preset interface library to the target browser, wherein the preset interface library records APIs (application program interfaces) corresponding to a plurality of browsers with different types and different versions;
Receiving the preset interface library;
And generating a target API corresponding to the target browser according to the preset interface library.
Optionally, the preset interface library records common API parts corresponding to multiple browsers of different types and different versions, and differential API parts corresponding to each browser;
the generating, according to the preset interface library, a target API corresponding to the target browser includes:
acquiring a difference API part corresponding to the type of the target browser and the version number of the target browser from the preset interface library as a target difference API part;
And combining the common API part and the target difference API part to obtain a target API corresponding to the target browser.
Optionally, the target difference API records a correspondence between an original function identifier of each function module and a mapping function identifier of each function module in the target browser.
Optionally, if the target function module is an audio function module, the first target resource is an audio file, and if the target function module is a video function module, the first target resource is a video file.
Optionally, the method further comprises:
And receiving a second target resource sent by the instant messaging server, wherein the second target resource is a resource sent by other browsers except the target browser and received by the instant messaging server.
In a second aspect of the present invention, there is also provided a communication method, the method being applied to an instant messaging server, the method comprising:
The method comprises the steps of sending a call request for a target function module to a target browser, wherein the call request comprises a first original function identifier of the target function module in the browser matched with the version of the instant messaging server, determining a mapping function identifier corresponding to the first original function identifier as the target function identifier of the target function module in the target browser based on a corresponding relation between the original function identifier of each function module and the mapping function identifier of each function module in the target browser recorded in a target API corresponding to the target browser, calling the target function module according to the target function identifier to obtain a first target resource, and sending the first target resource to the instant messaging server;
And receiving the first target resource.
Optionally, before the call request for the target function module sent to the target browser, the method further includes:
receiving a connection request sent by the target browser;
The method comprises the steps of receiving a target browser, sending a preset interface library to the target browser, recording common API parts corresponding to a plurality of browsers of different types and different versions and differential API parts corresponding to each browser in the preset interface library, enabling the target browser to receive the preset interface library, obtaining differential API parts corresponding to the types of the target browser and version numbers of the target browser from the preset interface library to serve as target differential API parts, and combining the common API parts and the target differential API parts to obtain target APIs corresponding to the target browser.
Optionally, the target difference API records a correspondence between an original function identifier of each function module and a mapping function identifier of each function module in the target browser.
Optionally, if the target function module is an audio function module, the first target resource is an audio file, and if the target function module is a video function module, the first target resource is a video file.
Optionally, the method further comprises:
receiving a second target resource sent by other browsers except the target browser;
And sending the second target resource to the target browser.
In a third aspect of the present invention, there is also provided a communication system, the communication system including a target browser, an instant messaging server, wherein:
the instant messaging server is used for sending a call request aiming at a target function module to the target browser, wherein the call request comprises a first original function identifier of the target function module in the browser matched with the version of the instant messaging server;
the target browser is used for receiving the calling request, determining a mapping function identifier corresponding to the first original function identifier based on the corresponding relation between the original function identifier of each function module and the mapping function identifier of each function module in the target browser, which is recorded in a first target API corresponding to the target browser, and calling the target function module according to the target function identifier to obtain a first target resource;
The instant messaging server is further configured to receive the first target resource.
In a fourth aspect of the present invention, there is also provided a communication apparatus, the apparatus being applied to a target browser, the apparatus comprising:
the system comprises a first receiving module, a second receiving module and a target function module, wherein the first receiving module is used for receiving a call request aiming at the target function module, which is sent by an instant messaging server, and the call request comprises a first original function identifier of the target function module in a browser matched with the version of the instant messaging server;
The target function identification determining module is used for determining a mapping function identification corresponding to the first original function identification based on the corresponding relation between the original function identification of each function module and the mapping function identification of each function module in the target browser, which is recorded in the target application program interface API corresponding to the target browser, and taking the mapping function identification as the target function identification of the target function module in the target browser;
the function calling module is used for calling the target function module according to the target function identifier so as to obtain a first target resource;
and the first sending module is used for sending the first target resource to the instant messaging server.
Optionally, the apparatus further includes:
The second sending module is used for sending a connection request to the instant messaging server before receiving the call request for the target function module sent by the instant messaging server so that the instant messaging server sends a preset interface library to the target browser, wherein the preset interface library records APIs (application program interfaces) corresponding to a plurality of browsers of different types and different versions;
the second receiving module is used for receiving the preset interface library;
And the target API generation module is used for generating a target API corresponding to the target browser according to the preset interface library.
Optionally, the preset interface library records common API parts corresponding to multiple browsers of different types and different versions, and differential API parts corresponding to each browser;
the target API generation module comprises:
a difference API part obtaining submodule, configured to obtain, from the preset interface library, a difference API part corresponding to the type of the target browser and the version number of the target browser, as a target difference API part;
And the target API generation submodule is used for combining the common API part and the target difference API part to obtain a target API corresponding to the target browser.
Optionally, the target difference API records a correspondence between an original function identifier of each function module and a mapping function identifier of each function module in the target browser.
Optionally, if the target function module is an audio function module, the first target resource is an audio file, and if the target function module is a video function module, the first target resource is a video file.
Optionally, the apparatus further includes:
and the third receiving module is used for receiving a second target resource sent by the instant messaging server, wherein the second target resource is a resource sent by other browsers except the target browser and received by the instant messaging server.
In a fifth aspect of the present invention, there is also provided a communication apparatus, the apparatus being applied to an instant messaging server, the apparatus comprising:
The system comprises a target browser, a first sending module, a first resource and a second resource, wherein the target browser is used for sending a call request aiming at a target function module to the target browser, the call request comprises a first original function identifier of the target function module in the browser matched with the version of the instant messaging server, so that the target browser determines a mapping function identifier corresponding to the first original function identifier as the target function identifier of the target function module in the target browser based on the corresponding relation between the original function identifier of each function module and the mapping function identifier of each function module in the target browser recorded in a target API corresponding to the target browser;
and the first receiving module is used for receiving the first target resource.
Optionally, the apparatus further includes:
The second receiving module is used for receiving a connection request sent by the target browser before the call request sent to the target browser for the target function module;
the target browser comprises a first sending module, a second sending module and a target browser, wherein the first sending module is used for sending a preset interface library to the target browser, the preset interface library records common API parts corresponding to a plurality of browsers with different types and different versions and differential API parts corresponding to each browser, so that the target browser receives the preset interface library, obtains the differential API parts corresponding to the types of the target browser and the version numbers of the target browser from the preset interface library and serves as a target differential API part, and combines the common API parts and the target differential API parts to obtain target APIs corresponding to the target browser.
Optionally, the target difference API records a correspondence between an original function identifier of each function module and a mapping function identifier of each function module in the target browser.
Optionally, if the target function module is an audio function module, the first target resource is an audio file, and if the target function module is a video function module, the first target resource is a video file.
Optionally, the apparatus further includes:
the third receiving module is used for receiving second target resources sent by other browsers except the target browser;
and the third sending module is used for sending the second target resource to the target browser.
The embodiment of the invention also provides the electronic equipment which is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the communication methods when executing the program stored in the memory.
The embodiment of the invention also provides a computer readable storage medium, which is characterized in that a computer program is stored in the computer readable storage medium, and the computer program realizes any one of the communication methods when being executed by a processor.
Embodiments of the present invention also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the communication methods described above.
The communication method provided by the embodiment of the invention receives a call request for a target function module sent by an instant messaging server, wherein the call request comprises a first original function identifier of the target function module in a browser matched with a version of the instant messaging server, determines a mapping function identifier corresponding to the first original function identifier based on a corresponding relation between the original function identifier of each function module and the mapping function identifier of each function module in the target browser recorded in a target API corresponding to the target browser, and serves as the target function identifier of the target function module in the target browser, calls the target function module according to the target function identifier to obtain a first target resource, and sends the first target resource to the instant messaging server.
After the original function identification is received, the corresponding target function identification in the target browser can be determined based on the target API, namely, even if the target browser is upgraded, the function identification used for calling the target function module in the upgraded target browser can be determined, and the target browser can call the target function module based on the target function identification to obtain a first target resource, so that data communication between the target browser and the instant messaging server is realized, and communication service interruption is avoided.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by the person skilled in the art based on the present application are included in the scope of protection of the present application.
In the prior art, when a browser performs version upgrade, function identifiers corresponding to all function modules in the browser may change, and when the upgraded browser receives a call request for the function modules sent by an instant messaging server, the corresponding function modules may not be called according to the function identifiers in the call request. And the browser and the instant messaging server cannot communicate data, so that the communication service is interrupted.
In order to solve the above problems, the embodiment of the invention provides a communication method applied to a target browser. Referring to fig. 1, fig. 1 is a flowchart of a communication method according to an embodiment of the present invention, where the method may include the following steps:
s101, receiving a call request for a target function module sent by an instant messaging server.
S102, determining a mapping function identifier corresponding to the first original function identifier based on the corresponding relation between the original function identifiers of the function modules and the mapping function identifiers of the function modules in the target browser, which are recorded in the target API corresponding to the target browser, and taking the mapping function identifier as the target function identifier of the target function module in the target browser.
S103, calling a target function module according to the target function identification to obtain a first target resource.
And S104, sending the first target resource to the instant messaging server.
The call request comprises a first original function identifier of the target function module in the browser matched with the version of the instant messaging server.
According to the communication method provided by the embodiment of the invention, after the original function identification is received, the corresponding target function identification in the target browser can be determined based on the target API, namely, even if the target browser is upgraded, the function identification for calling the target function module in the upgraded target browser can be determined, and the target browser can call the target function module based on the target function identification to obtain the first target resource, so that the data communication between the target browser and the instant messaging server is realized, and the interruption of communication service is avoided.
In one implementation, the target browser may be any type and any version of browser, and each functional module based on WebRTC protocol, such as an audio functional module and a video functional module, is built in the target browser. The target functional module may be any of the functional modules described above. In order to realize the video communication among the browsers, the instant communication server can send a call request for the video function to the target browser, so that the target browser calls the video function module to obtain the video file, the video file is sent to other browsers except the target browser by the instant communication server, and in order to realize the video communication among the browsers, the instant communication server can send a call request for the video function to the target browser, so that the target browser calls the video function module to obtain the video file, the video file is sent to the instant communication server, and the video file is sent to the other browsers except the target browser by the instant communication server.
The function identifier corresponding to the target function module, the representation is in the target browser of the object, an interface number for an interface that invokes the target function module.
According to the manufacturer of the browser, the browser can be divided into different types, for example, the browser A is developed by the manufacturer A of the browser, the browser B is developed by the manufacturer B of the browser, and interfaces for calling the same functional module can be different among different types of browsers. Since the manufacturer of the browser will update the version of the browser, there may be different versions of the same type of browser, for example, the manufacturer a of the browser may develop a browser a, the browser a may have a 1.0 version of browser a, a 1.3 version of browser a, a 2.0 version of browser a, etc., and interfaces for invoking the same function module may be different between the same type of browser but different versions of browser.
For a certain type of browser, the first original function identifier carried in the call request for the target function module sent by the instant messaging server to the browser can be an interface number corresponding to the target function module in a browser of a designated version of the browser.
For example, when deploying an instant messaging server, a browser a with more version 3.0 is currently used, and an audio function module based on WebRTC protocol in the browser a with version 3.0 corresponds to interface 1 and a video function module corresponds to interface 2, then a technician may set an original function identifier in a call request for the audio function module to interface 1 and an original function identifier in a call request for the video function module to interface 2. When the instant communication server sends the calling request aiming at the video function module to the browser A of different versions, the original function of the calling request is identified as an interface 1, and when the instant communication server sends the calling request aiming at the video function module to the browser A of different versions, the original function of the calling request is identified as an interface 2.
In one implementation, the version of the target browser may be a specified version, or may be another version, if the version of the target browser is the specified version, the first original function identifier is the same as the corresponding mapping function identifier, and if the version of the target browser is not the specified version, the first original function identifier may not be the same as the corresponding mapping function identifier.
The technician can use the function identifiers corresponding to the function modules in the browser as mapping function identifiers. The API may record a correspondence between the original function identifier of each function module and the mapping function identifier, and the browser may determine the corresponding mapping function identifier according to the original function identifier of each function module, and call each function module through the corresponding mapping function identifier. Therefore, when the browser upgrades the version, the technician only needs to add the corresponding relation between the original function identifier and the mapping function identifier in the new API corresponding to the upgraded browser, and the upgraded browser can call the function module according to the call request for the function module sent by the new API and the instant messaging server. The call request for the function module sent by the instant messaging server is not required to be modified, and modification and test of program codes in the instant messaging server are avoided.
For example, in the call request of the instant messaging server for the audio function module, the recorded original function is identified as interface 1, and the audio function module corresponds to interface 5 in the target browser. The corresponding relationship between the original function identifier and the mapping function identifier recorded in the target API is the corresponding relationship between the interface 1 and the interface 5. When the target browser receives the request for calling the interface 1, the target browser can confirm that the mapping function interface corresponding to the interface 1 is the interface 5 through the target API, and then call the audio function module through the interface 5.
In one embodiment, the first target resource is an audio file if the target function module is an audio function module, and the first target resource is a video file if the target function module is a video function module.
The resource type of the first target resource is determined by the type of the target function module.
To enable audio communication between browsers, the instant messaging server may send a call request for the audio function module to the target browser. In order to achieve video communication between browsers, the instant messaging server may send a call request for the video function module to the target browser.
In one embodiment, referring to fig. 2, the method may further include, prior to step S101 on the basis of fig. 1:
S105, sending a connection request to the instant messaging server so that the instant messaging server sends a preset interface library to the target browser.
S106, receiving a preset interface library.
And S107, generating a target API corresponding to the target browser according to the preset interface library.
The preset interface library records APIs corresponding to a plurality of browsers of different types and different versions.
In one implementation, the preset interface library may be a JS library created in advance by a technician. A technician can modify the JS library, add APIs of browsers of different types and versions, and expand the application range of the JS library, so that more browsers of different types and versions can communicate data through the instant messaging server.
In one embodiment, a common API portion corresponding to a plurality of browsers of different types and different versions and a differential API portion corresponding to each browser are recorded in a preset interface library.
Referring to fig. 3, on the basis of fig. 2, step S107 includes:
S1071, acquiring a difference API part corresponding to the type of the target browser and the version number of the target browser from a preset interface library as a target difference API part.
And S1072, combining the common API part and the target difference API part to obtain a target API corresponding to the target browser.
Recorded in the preset interface library is the correspondence between the differential API portion and the browser type and browser version.
In one implementation, the common API part is a program code part for implementing the same function for all APIs in the preset interface library, and the program code part with the same function can be used as a parent class of all APIs. The differential API part is a program code part (differential code part) of each API implementing a function different from that of other APIs in the preset interface library, and the differential code part of the API may be regarded as a subclass of the API.
In one embodiment, the target difference API portion records a correspondence between the original function identifier of each function module and the mapped function identifier of each function module in the target browser.
For example, 10 APIs corresponding to the browser are stored in the preset interface library, and each of the 10 APIs has a differential API portion, so that 10 differential API portions can be stored in the preset interface library, and a common API portion of the 10 APIs is stored.
In this embodiment, the APIs in the preset interface library are formed by combining a common API portion and a differential API portion, and only the differential API portion in the APIs corresponding to each browser is different. Therefore, when the browser is subjected to version upgrading, a technician does not need to write the whole program code of the API corresponding to the upgraded browser, only needs to write the program code of the difference API part corresponding to the upgraded browser, and stores the program code into a preset interface library. The updated browser can generate a corresponding API through a preset interface library. The effort to write the program code of the API can be reduced.
Referring to fig. 4, fig. 4 is a schematic diagram of a preset interface library according to an embodiment of the present invention.
Devices represent the preset interface library, HANDLER INTERFACE (processor interface) represents the common API part, chrome58, safari11 represent the differential API part, chrome, safari represents the browser type, and 58, 11 represent the browser version number.
In one embodiment, a second target resource sent by the instant messaging server is received, where the second target resource is a resource sent by a browser other than the target browser and received by the instant messaging server.
The second target resource is an audio file if the instant messaging server sends a call request for the audio function module to any other browser, and is a video file if the instant messaging server sends a call request for the video function module to any other browser.
Any other browser can execute the same steps as the target browser to generate a second target resource, send the second target resource to the instant messaging server, and send the second target resource to the target browser by the instant messaging server.
In one implementation, the target browser may communicate data with any other browser (the third browser) through the instant messaging server, and send audio files or video files to each other. For example, user a uses a target browser to make a voice call or a video call with user B using a third browser.
In another implementation, the target browser may only send audio files or video files to the instant messaging server, and the third browser only receives audio files or video files forwarded by the instant messaging server. For example, when the user a uses the target browser to open live broadcast, the target browser only sends the audio file or the video file to the instant messaging server, and when the user B views live broadcast of the user a through the third browser, the third browser only receives the audio file or the video file forwarded by the instant messaging server.
In another implementation, the target browser may only send audio files or video files to the receiving communication server, and the third browser may only send audio files or video files to the instant communication server. For example, if the user B uses the third browser to open live broadcast, the third browser only sends the audio file or the video file to the instant messaging server, and if the user a views live broadcast of the user B through the target browser, the target browser only receives the audio file or the video file forwarded by the instant messaging server.
Based on the same inventive concept, the present invention also provides a communication method applied to an instant messaging server, referring to fig. 5, fig. 5 is a flowchart of a communication method provided by an embodiment of the present invention, where the method may include the following steps:
s501, sending a call request for a target function module to a target browser.
The calling request comprises a first original function identifier of a target function module in a browser matched with a version of the instant messaging server, the target browser is enabled to determine a mapping function identifier corresponding to the first original function identifier based on a corresponding relation between the original function identifier of each function module and the mapping function identifier of each function module in the target browser, which is recorded in a target API corresponding to the target browser, the mapping function identifier is used as a target function identifier of the target function module in the target browser, the target function module is called according to the target function identifier to obtain a first target resource, and the first target resource is sent to the instant messaging server.
S502, receiving a first target resource.
According to the communication method provided by the embodiment of the invention, after the original function identification is received, the corresponding target function identification in the target browser can be determined based on the target API, namely, even if the target browser is upgraded, the function identification for calling the target function module in the upgraded target browser can be determined, and the target browser can call the target function module based on the target function identification to obtain the first target resource, so that the data communication between the target browser and the instant messaging server is realized, and the interruption of communication service is avoided.
The processing method of the target browser may refer to the description of steps S101 to S104.
In one embodiment, referring to fig. 6, the method may further include, prior to step S501 on the basis of fig. 5:
S503, receiving a connection request sent by the target browser.
S504, sending a preset interface library to the target browser.
The method comprises the steps of recording common API parts corresponding to a plurality of browsers of different types and different versions and differential API parts corresponding to each browser in a preset interface library, enabling a target browser to receive the preset interface library, acquiring the differential API parts corresponding to the types of the target browser and the version numbers of the target browser from the preset interface library to serve as target differential API parts, and combining the common API parts and the target differential API parts to obtain target APIs corresponding to the target browser.
The processing method of the target browser may refer to the description of steps S1071-S1072.
In one embodiment, the target difference API portion records a correspondence between the original function identifier of each function module and the mapped function identifier of each function module in the target browser.
In one embodiment, the first target resource is an audio file if the target function module is an audio function module, and the first target resource is a video file if the target function module is a video function module.
In one embodiment, the method further comprises:
and step one, receiving a second target resource sent by other browsers except the target browser.
And step two, sending a second target resource to the target browser.
In one implementation, the instant messaging server may receive a first target resource of a target browser, and may also send a second target resource of another browser to the target browser, i.e. may implement data communication between the browsers.
Based on the same inventive concept, the invention also provides a communication system. Referring to fig. 7, fig. 7 is a block diagram of a communication system according to an embodiment of the present invention, which includes an instant messaging server 701 and a plurality of browsers (including a browser 7021, a browser 7022, and a browser 7023). The embodiment of the present invention is described by taking 3 browsers as examples, but is not limited to this. The target browser may be any one of the above-described browser 7021, browser 7022, and browser 7023.
The instant communication server 701 is configured to send a call request for a target function module to a target browser, where the call request includes a first original function identifier of the target function module in the browser that matches with a version of the instant communication server;
the system comprises a target browser, a first target resource, a first instant messaging server, a second instant messaging server, a first target resource, a second instant messaging server, a first target function module, a second target function module, a first target function module and a second target resource, wherein the target browser is used for receiving a calling request, and determining a mapping function identifier corresponding to the first original function identifier based on a corresponding relation between an original function identifier of each function module and a mapping function identifier of each function module in the target browser, which is recorded in a first target API corresponding to the target browser, as a target function identifier of the target function module in the target browser;
The instant messaging server 701 is further configured to receive a first target resource.
Based on the communication system provided by the embodiment of the invention, after receiving the original function identifier, the target browser can determine the corresponding target function identifier in the target browser based on the target API, namely, even if the target browser is upgraded, the function identifier for calling the target function module in the upgraded target browser can be determined, and the target browser can call the target function module based on the target function identifier to obtain the first target resource, so that the data communication between the target browser and the instant communication server is realized, and the interruption of communication service is avoided.
Based on the same inventive concept, the embodiment of the present invention further provides a communication device, which is applied to a target browser, referring to fig. 8, fig. 8 is a structural diagram of the communication device provided by the embodiment of the present invention, where the device includes:
The first receiving module 801 is configured to receive a call request for a target function module sent by an instant messaging server, where the call request includes a first original function identifier of the target function module in a browser that matches a version of the instant messaging server;
The target function identifier determining module 802 is configured to determine, based on a correspondence between an original function identifier of each function module and a mapping function identifier of each function module in the target browser, which is recorded in a target application program interface API corresponding to the target browser, a mapping function identifier corresponding to the first original function identifier, and use the mapping function identifier as a target function identifier of the target function module in the target browser;
A function calling module 803, configured to call a target function module according to the target function identifier, so as to obtain a first target resource;
the first sending module 804 is configured to send the first target resource to the instant messaging server.
In one embodiment, the apparatus further comprises:
the second sending module is used for sending a connection request to the instant messaging server before receiving the call request for the target function module sent by the instant messaging server, so that the instant messaging server sends a preset interface library to the target browser;
The second receiving module is used for receiving a preset interface library;
And the target API generation module is used for generating a target API corresponding to the target browser according to the preset interface library.
In one embodiment, a common API portion corresponding to a plurality of browsers of different types and different versions and a differential API portion corresponding to each browser are recorded in a preset interface library;
A target API generation module comprising:
The difference API part acquisition submodule is used for acquiring a difference API part corresponding to the type of the target browser and the version number of the target browser from a preset interface library and taking the difference API part as a target difference API part;
and the target API generation submodule is used for combining the shared API part and the target difference API part to obtain a target API corresponding to the target browser.
In one embodiment, the target difference API portion records a correspondence between the original function identifier of each function module and the mapped function identifier of each function module in the target browser.
In one embodiment, the first target resource is an audio file if the target function module is an audio function module, and the first target resource is a video file if the target function module is a video function module.
In one embodiment, the apparatus further comprises:
The third receiving module is configured to receive a second target resource sent by the instant messaging server, where the second target resource is a resource sent by a browser other than the target browser to the instant messaging server.
Based on the same inventive concept, the embodiment of the present invention further provides a communication device, which is applied to an instant messaging server, referring to fig. 9, fig. 9 is a structural diagram of the communication device provided by the embodiment of the present invention, where the device includes:
The first sending module 901 is used for sending a call request aiming at a target function module to a target browser, wherein the call request comprises a first original function identifier of the target function module in the browser matched with the version of the instant messaging server, so that the target browser determines a mapping function identifier corresponding to the first original function identifier based on a corresponding relation between the original function identifier of each function module and the mapping function identifier of each function module in the target browser recorded in a target API corresponding to the target browser, and takes the mapping function identifier as the target function identifier of the target function module in the target browser;
a first receiving module 902 is configured to receive a first target resource.
In one embodiment, the apparatus further comprises:
the second receiving module is used for receiving a connection request sent by the target browser before a call request sent to the target browser for the target function module;
The system comprises a first sending module, a second sending module and a target browser, wherein the first sending module is used for sending a preset interface library to the target browser, common API parts corresponding to a plurality of browsers of different types and different versions and differential API parts corresponding to each browser are recorded in the preset interface library, so that the target browser receives the preset interface library, acquires the differential API parts corresponding to the types of the target browser and the version numbers of the target browser from the preset interface library and serves as a target differential API part, and combines the common API parts and the target differential API parts to obtain target APIs corresponding to the target browser.
In one embodiment, the target difference API portion records a correspondence between the original function identifier of each function module and the mapped function identifier of each function module in the target browser.
In one embodiment, the first target resource is an audio file if the target function module is an audio function module, and the first target resource is a video file if the target function module is a video function module.
In one embodiment, the apparatus further comprises:
The third receiving module is used for receiving second target resources sent by other browsers except the target browser;
and the third sending module is used for sending the second target resource to the target browser.
The embodiment of the invention also provides an electronic device, as shown in fig. 10, which comprises a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002 and the memory 1003 complete communication with each other through the communication bus 1004,
A memory 1003 for storing a computer program;
The processor 1001 is configured to implement the communication method according to any of the above embodiments when executing the program stored in the memory 1003.
The communication bus mentioned above for the electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The Processor may be a general-purpose Processor including a central processing unit (Central Processing Unit, CPU), a network Processor (Network Processor, NP), etc., or may be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present invention, there is also provided a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of any of the communication methods described above.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the communication methods of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system, apparatus, electronic device, computer readable storage medium, and computer program product embodiments, the description is relatively simple as it is substantially similar to method embodiments, as relevant points are found in the partial description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.