CN111143083B - Data transmission method and device, storage medium and electronic device - Google Patents

Data transmission method and device, storage medium and electronic device Download PDF

Info

Publication number
CN111143083B
CN111143083B CN201911122460.0A CN201911122460A CN111143083B CN 111143083 B CN111143083 B CN 111143083B CN 201911122460 A CN201911122460 A CN 201911122460A CN 111143083 B CN111143083 B CN 111143083B
Authority
CN
China
Prior art keywords
cache
plug
target
request
transmission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911122460.0A
Other languages
Chinese (zh)
Other versions
CN111143083A (en
Inventor
付政委
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN201911122460.0A priority Critical patent/CN111143083B/en
Publication of CN111143083A publication Critical patent/CN111143083A/en
Application granted granted Critical
Publication of CN111143083B publication Critical patent/CN111143083B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The application discloses a data transmission method and device, a storage medium and an electronic device. Wherein, the method comprises the following steps: receiving a first request of a target device, wherein the first request is used for requesting data transmission between the target device and a first cache, and the first cache is a cache indicated by the first request in a plurality of caches belonging to the same type; searching a first target plug-in matched with a first transmission scheme from a plurality of plug-ins, wherein each plug-in the plurality of plug-ins is matched with one transmission scheme, caches with different transmission schemes exist in the plurality of caches, and the first transmission scheme is a transmission scheme adopted by the first cache; and completing data transmission between the target equipment and the first cache through the first target plug-in. The method and the device solve the technical problem that the complexity of data transmission between the related art and the cache is high.

Description

Data transmission method and device, storage medium and electronic device
Technical Field
The present application relates to the field of internet, and in particular, to a data transmission method and apparatus, a storage medium, and an electronic apparatus.
Background
With the business development of banks, the development of internet technology, the continuous upgrade of social consumption and the increasing complexity of business, the existing requirements cannot be met by relying on the traditional offline transaction mode. Meanwhile, as the convergence between banking, company business and the internet is continuously improved, the internet-based transaction has become the mainstream gradually.
In implementing the present invention, the inventors discovered that during an internet-based transaction, parties to the transaction may use the same cache, but the upper level encapsulation is different, resulting in higher complexity of data transmission.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides a data transmission method and device, a storage medium and an electronic device, so as to at least solve the technical problem that the complexity of data transmission between a cache and a related technology is high.
According to an aspect of an embodiment of the present application, there is provided a data transmission method, including: receiving a first request of a target device, wherein the first request is used for requesting data transmission between the target device and a first cache, and the first cache is a cache indicated by the first request in a plurality of caches belonging to the same type; searching a first target plug-in matched with a first transmission scheme from a plurality of plug-ins, wherein each plug-in the plurality of plug-ins is matched with one transmission scheme, caches with different transmission schemes exist in the plurality of caches, and the first transmission scheme is a transmission scheme adopted by the first cache; and completing data transmission between the target equipment and the first cache through the first target plug-in.
According to another aspect of the embodiments of the present application, there is also provided a data transmission apparatus, including: the device comprises a receiving unit, a first cache and a second cache, wherein the receiving unit is used for receiving a first request of a target device, the first request is used for requesting data transmission between the target device and the first cache, and the first cache is a cache indicated by the first request in a plurality of caches of the same type; the system comprises a searching unit, a transmission unit and a processing unit, wherein the searching unit is used for searching a first target plug-in matched with a first transmission scheme from a plurality of plug-ins, each plug-in the plurality of plug-ins is matched with one transmission scheme, caches with different transmission schemes exist in the plurality of caches, and the first transmission scheme is a transmission scheme adopted by the first cache; and the transmission unit is used for completing data transmission between the target equipment and the first cache through the first target plug-in.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program which when executed performs the above method.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above method through the computer program.
In the embodiment of the application, the plug-ins of various transmission schemes are packaged into the middleware, the interfaces of each cache are uniformly adapted through the middleware, and the interfaces of each cache do not need to be replaced, so that the technical problem that the complexity of data transmission between the cache and the related technology is high can be solved, and the technical effect of reducing the complexity of data transmission between the cache and the related technology is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic diagram of a hardware environment of a data transmission method according to an embodiment of the present application;
FIG. 2 is a flow chart of an alternative method of data transmission according to an embodiment of the application;
FIG. 3 is a schematic diagram of an alternative data transmission scheme according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an alternative data transmission apparatus according to an embodiment of the present application; and the number of the first and second groups,
fig. 5 is a block diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, partial nouns or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
redis (full name: Remote Dictionary Server Remote Dictionary service): the system is an open source log-type and Key-Value database which is written by using ANSI C language, supports network, can be based on memory and can also be persistent, and provides API of multiple languages.
Packaging, namely hiding the attribute and implementation details of the object, externally disclosing an interface, and controlling the access level of reading and modifying the attribute in the program; the abstracted data and behaviors (or functions) are combined to form an organic whole, namely, the data and source codes of operation data are combined organically to form a class, wherein the data and the functions are members of the class.
Spring MVC: the Web layer task decoupling framework is a lightweight Web framework based on Java, realizes a Web MVC design mode and a request drive type, and decouples Web layer tasks by using the idea of MVC architecture mode. Based on the fact that the request-driven finger is used for a request-response model, the purpose of the framework is to help us to simplify development, and SpringMVC is also to simplify daily Web development of us.
XML: the full english name Extensible Markup Language, a subset of standard universal Markup languages, is a Markup Language for marking electronic documents to be structured.
According to an aspect of embodiments of the present application, a method embodiment of a method for transmitting data is provided.
Alternatively, in this embodiment, the data transmission method may be applied to a hardware environment formed by the server 101 and the buffer 103 as shown in fig. 1. As shown in fig. 1, a server 101 is connected to a cache 103 (a specific number of caches is multiple) through a network, and the server may be used to provide services (such as game services, financial services, etc.) for a terminal or a client installed on the terminal, where the network includes but is not limited to: the server 101 is not limited to a PC, a virtual machine, a server, or the like, and the middleware 105 according to the technical scheme of the present application may be disposed between the server 101 and the cache 103, and the middleware 105 may run on the server independently or may be integrated into the server. The data transmission method of the embodiment of the application can be executed by the server 101, for example, the server calls a middleware to execute, or the middleware can be integrated into the server and directly executed by the server; if the middleware is not integrated in the server, the middleware can be executed by the server where the middleware is located.
Fig. 2 is a flowchart of an optional data transmission method according to an embodiment of the present application, and as shown in fig. 2, the method may include the following steps:
step S202, the middleware receives a first request of the target device, where the first request is used to request data transmission between the target device and a first cache, and the first cache is a cache indicated by the first request in multiple caches of the same type, for example, the first request carries information such as an identifier and an address of the first cache.
The middleware may be configured to implement data transmission of multiple transmission schemes, and optionally, may also be configured to implement selection of transmission schemes (each transmission scheme may correspond to one identifier, and each cache also has an identifier corresponding to the transmission scheme adopted by the cache, so that the middleware may determine an actually selected transmission scheme by using the identifier corresponding to the cache indicated in the request), switching of transmission schemes (for example, switching transmission schemes when switching caches), where an optional implementation manner of the middleware is to encapsulate multiple transmission schemes into multiple plug-ins (each plug-in integrates transmission logic of one transmission scheme), and integrate management logic of the multiple plug-ins (for example, matching of plug-ins, switching of plug-ins, setting of transmission rate, and the like) in the middleware; the plurality of caches are distributed caches, and data transmission between the target device and the first cache may be performed by writing data into the first cache for the target device, or by reading data from the first cache for the target device.
The cache has the characteristic of improving the instruction and data reading speed, and is widely applied in the field of distributed computing along with the expansion of a local computer system to a distributed system, namely the distributed cache.
The above-mentioned "data transmission" may include two ways, one is that the target device reads data from the first cache, and the other is that the target device writes data into the first cache (for the sake of uniform description, hereinafter, "write data" is described as an example), and it is apparent that the target device is a device that reads data from the cache or writes data into the cache, and may be a device such as a virtual machine, a server, a computer, a mobile terminal, and the like.
Step S204, the middleware searches a first target plug-in matched with the first transmission scheme from the plurality of plug-ins, each plug-in the plurality of plug-ins is matched with one transmission scheme (the transmission schemes corresponding to any two plug-ins are different), caches with different transmission schemes exist in the plurality of caches, and the first transmission scheme is the transmission scheme adopted by the first cache.
The transmission scheme is a specific data transmission protocol, transmission timing control, and the like, such as a transmission scheme corresponding to JimDB and a transmission scheme corresponding to R2M.
Step S206, the middleware completes data transmission between the target device and the first cache through the first target plug-in.
Through the steps, the plug-in units of various transmission schemes are packaged into the middleware, the interfaces of the caches are uniformly adapted through the middleware, the interfaces of each cache do not need to be replaced, the technical problem that the complexity of data transmission between the cache and the related technology is high can be solved, and the technical effect of reducing the complexity of data transmission between the cache and the related technology is achieved. The technical solution of the present application is further detailed below with reference to the steps shown in fig. 2.
In the technical solution provided in step S202, a first request of a target device is received, where the first request is used to request data transmission between the target device and a first cache, and the first cache is a cache indicated by the first request in multiple caches belonging to the same type.
For example, the caches may be caches of multiple business parties, for example, a business party includes finance, a mall, and the like, and the caches include a financial cache a, a mall cache B, and the like, for example, when a user purchases a commodity in the mall, the user needs to pay by using a financial service, and then data needs to be written into the cache a, and at this time, a terminal of the business party mall is triggered to generate a first request, where the request carries an identifier of the cache a.
In the technical solution provided in step S204, a first target plug-in that matches a first transmission scheme is searched from a plurality of plug-ins, each plug-in the plurality of plug-ins matches one transmission scheme, a cache with a different transmission scheme exists in the plurality of caches, and the first transmission scheme is a transmission scheme adopted by the first cache.
Optionally, generally, the caching of the same service is in a master-slave configuration, and the searching for the first target plug-in matching the first transmission scheme from the plurality of plug-ins includes: searching a first plug-in matched with a first scheme from a plurality of plug-ins, wherein the first transmission scheme comprises the first scheme, the first target plug-in comprises the first plug-in, and the first scheme is a transmission scheme adopted by a main cache in a first cache; and searching a second plug-in matched with the second scheme from the plurality of plug-ins, wherein the first transmission scheme comprises the second scheme, the first target plug-in comprises the second plug-in, and the second scheme is a transmission scheme adopted from the cache in the first cache.
The above-mentioned primary buffer and secondary buffer may use the same interface (i.e. transmission scheme), or may use different transmission schemes, and there is 1: and N is an integer greater than or equal to 1, and when the main cache fails, master-slave switching can be performed, namely the main cache is switched into the slave cache, and the slave cache is switched into the main cache.
In the technical solution provided in step S206, the data transmission between the target device and the first cache is completed through the first target plug-in.
Optionally, the completing, by the first target plug-in, data transmission between the target device and the first cache includes: determining a target interface adopted by a first cache, wherein the interface of any cache in a plurality of caches is obtained by packaging a transmission scheme adopted by any cache; and completing data transmission between the target equipment and the target interface through the first target plug-in.
It should be noted that the first request may also carry configuration parameters, for example, the synchronous mode of the master cache and the slave cache in the first cache is set to asynchronous transmission, that is, data is transmitted on the master cache first, and then data is transmitted from the slave cache when the network condition allows.
Optionally, before starting or during the data transmission, the target device may perform a transmission configuration, for example, after receiving a first request of the target device, send and receive a second request to the middleware, where the second request is used to request to perform a caching operation, and the caching operation includes at least one of master-slave switching of a cache, synchronous writing (i.e., data writing is performed on the master cache and the slave cache simultaneously), asynchronous writing (i.e., data is transmitted on the master cache first, and then data is transmitted on the slave cache), and closing reading and writing; and under the condition that the terminal identification carried in the second request is the same as the terminal identification carried in the first request, performing caching operation on the first cache.
Optionally, before starting or during data transmission, the target device may perform cache switching (i.e., writing data in another cache), and after receiving the first request of the target device, receive a third request, where the third request is used to request to switch the cache to a second cache; under the condition that the terminal identification (the terminal identification is used for identifying the sending terminal of the request) carried in the third request is the same as the terminal identification carried in the first request, searching a second target plug-in matched with a second transmission scheme from the plurality of plug-ins, wherein the second transmission scheme is a transmission scheme adopted by a second cache; and completing data transmission between the target equipment and the second cache through the second target plug-in.
Similar to the previous scheme, finding a second target plug-in from the plurality of plug-ins that matches the second transmission scheme comprises: searching a third plug-in matched with a third scheme from the plurality of plug-ins, wherein the second transmission scheme comprises the third scheme, the second target plug-in comprises the third plug-in, and the third scheme is a transmission scheme adopted by a main cache in a second cache; and searching a fourth plug-in matched with a fourth scheme from the plurality of plug-ins, wherein the second transmission scheme comprises the fourth scheme, the second target plug-in comprises the fourth plug-in, and the fourth scheme is a transmission scheme adopted from the cache in the second cache.
As an optional embodiment, the following takes cache as Redis as an example, and details the technical solution of the present application in combination with a specific real-time scene.
For example, in an actual service scenario, part of hot data needs to be stored in the Redis, and it is desirable that the data is not lost as much as possible during the data use process, and in an emergency, switching between read and write modes can be performed to ensure the optimal performance of the system. In the actual process, the JimDB is used for cache database processing at first, and the JimDB is taken off line and needs to be replaced by R2M, if the manual replacement efficiency of each project is low.
In order to solve the above mentioned problems, the present application provides a technical solution as shown in fig. 3:
caching multi-read multi-write middleware, combining interfaces (namely transmission mode interfaces) such as JimDB (JIM for short), R2M, Redis and the like to form a template (such as classes in software) which can be multiplexed or called, and performing more convenient control in a mode of calling the template, wherein the configuration comprises the steps of; master read ID, synchronous write, asynchronous write, write off, read on, read off (to flush the cache).
The requirements of service systems are met, but each service system is not expected to be concerned about processing of cache (such as Redis), non-service functions are stripped, and independent middleware is provided for development, so that the middleware is a tool combination (including a tool template under the Redis cache) of various caches, and the processing is uniformly controlled by the middleware and comprises the following steps of; main read switching, synchronous writing, asynchronous writing, write closing, read opening, read closing and the like.
Cache backup and double writing (such as interfaces of JimDB and R2M for backup and physical isolation) are realized through middleware when JimDB and R2M are required to be written, JimDB and R2M are fused, more control can be performed through realizing a calling template, and configuration comprises the steps of; primary read ID, synchronous write, asynchronous write, write off, read on, read off (for flushing the cache).
The internal logic of the package is as follows: the middleware acquires configuration information when the service is started through XML configuration of Spring, and performs initialization caching { Redis, R2M, and the like } service. And recording the unique identifier ID of each cache service into a memory of the running program in a key-value mode so as to ensure that the cache can be operated and controlled subsequently. The middleware provides an extended implementation class (such as an interface class in a java program, which is used for each caller to implement own control flow) which can be used for controlling and managing the cache service, and an applicable party can perform cache main read switching { such as switching cache A to cache B }, synchronous writing, asynchronous writing, read-write closing and other operations in the running process of the service program by implementing a control class method.
The method can be used for downloading jar packages (namely packages where the middleware is located) by introducing POM files, is used for proxy cache service by adding XML configuration, is configured to support multiple groups by JimDB cache, is configured to support multiple groups by R2M cache, is configured to support multiple groups by configuring service names, service addresses and various parameters, is configured with proxy interfaces, can specify main read IDs, and can be read randomly when not set, and the like.
The flow when calling externally is as follows:
in order to reduce the access and learning cost and enable plug-in removal when not needed without affecting the original business process, the middleware is realized by adopting a dynamic agent and annotation control mode. When the method is used externally, XML configuration is carried out according to the specification so as to control multi-cache operation, and a middleware annotation is added to an original or newly-built cache operation method, so that the java class and a corresponding method can be cached by the middleware agent operation, and a user can operate the cache service without sensing in the actual use process.
The cache operation method in the annotation proxy class comprises the following steps: the method comprises the steps of configuring in a caching service class such as a caching service, adding monitoring according to needs, and adding comments on methods needing to be used.
For dynamic switching, extensible middleware can be implemented, and setting can be performed as required, for example, by taking a financial service as an example in the following manner: the read and write can be carried out through parameter setting, the hot switching primary read ID is configured, the priority is configured, the read switch is configured, the NULL is returned when the read is closed, the cache is convenient to refresh, the hot switching cache write type is configured, and the read, write, delete and the like can be carried out through setting.
By adopting the technical scheme, the interface is abstracted to configure the plug-in, the read-write control requirements of various interfaces can be met, the interface of each cache does not need to be replaced, and the working efficiency can be obviously improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (such as a ROM/RAM, a magnetic disk, and an optical disk), and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device) to execute the method described in the embodiments of the present application.
According to another aspect of the embodiments of the present application, there is also provided a data transmission apparatus for implementing the above data transmission method. Fig. 4 is a schematic diagram of an alternative data transmission apparatus according to an embodiment of the present application, and as shown in fig. 4, the apparatus may include:
the receiving unit 401 is configured to receive a first request of a target device, where the first request is used to request data transmission between the target device and a first cache, and the first cache is a cache indicated by the first request in multiple caches belonging to the same type.
A searching unit 403, configured to search for a first target plug-in that matches a first transmission scheme from among multiple plug-ins, where each plug-in the multiple plug-ins matches one transmission scheme, and there are caches with different transmission schemes in the multiple caches, where the first transmission scheme is a transmission scheme adopted by the first cache.
A transmission unit 405, configured to complete data transmission between the target device and the first cache through the first target plug-in.
It should be noted that the receiving unit 401 in this embodiment may be configured to execute step S202 in this embodiment, the searching unit 403 in this embodiment may be configured to execute step S204 in this embodiment, and the transmitting unit 405 in this embodiment may be configured to execute step S206 in this embodiment.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
Through the module, the plug-in units of various transmission schemes are packaged into the middleware, the interfaces of each cache are adapted uniformly through the middleware, the interfaces of each cache do not need to be replaced, the technical problem that the complexity of data transmission between the cache and the related technology is high can be solved, and the technical effect of reducing the complexity of data transmission between the cache and the related technology is achieved.
Optionally, the transmission unit includes: the determining module is used for determining a target interface adopted by the first cache, wherein the interface of any cache in the plurality of caches is obtained by packaging a transmission scheme adopted by any cache; and the transmission module is used for completing data transmission between the target equipment and the target interface through the first target plug-in.
Optionally, the search unit may be further configured to: searching a first plug-in matched with a first scheme from the plurality of plug-ins, wherein the first transmission scheme comprises the first scheme, the first target plug-in comprises the first plug-in, and the first scheme is a transmission scheme adopted by a main cache in the first cache; and searching a second plug-in matched with the second scheme from the plurality of plug-ins, wherein the first transmission scheme comprises the second scheme, the first target plug-in comprises the second plug-in, and the second scheme is a transmission scheme adopted from the cache in the first cache.
Optionally, the receiving unit may be further configured to: after receiving a first request of a target device, receiving a second request, wherein the second request is used for requesting to execute a cache operation, and the cache operation comprises at least one of master-slave switching, synchronous writing, asynchronous writing and closing reading and writing of a cache; the above apparatus may further include: and the operation unit is used for executing the caching operation on the first cache under the condition that the terminal identifier carried in the second request is the same as the terminal identifier carried in the first request.
Optionally, the receiving unit may be further configured to: after receiving the first request of the target device, receiving a third request, wherein the third request is used for requesting to switch the cache to a second cache; the search unit may be further configured to: under the condition that the terminal identification carried in the third request is the same as the terminal identification carried in the first request, searching a second target plug-in matched with a second transmission scheme from the plurality of plug-ins, wherein the second transmission scheme is a transmission scheme adopted by a second cache; the transmission unit may be further configured to complete data transmission between the target device and the second cache through the second target plug-in.
The transmission unit may be further configured to, when searching for a second target plug-in matching the second transmission scheme from the plurality of plug-ins: searching a third plug-in matched with a third scheme from the plurality of plug-ins, wherein the second transmission scheme comprises the third scheme, the second target plug-in comprises the third plug-in, and the third scheme is a transmission scheme adopted by a main cache in a second cache; and searching a fourth plug-in matched with a fourth scheme from the plurality of plug-ins, wherein the second transmission scheme comprises the fourth scheme, the second target plug-in comprises the fourth plug-in, and the fourth scheme is a transmission scheme adopted from the cache in the second cache.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to another aspect of the embodiment of the present application, there is also provided a server or a terminal for implementing the transmission method of the data.
Fig. 5 is a block diagram of a terminal according to an embodiment of the present application, where as shown in fig. 5, the terminal may include: one or more processors 501 (only one of which is shown in fig. 5), a memory 503, and a transmission means 505. as shown in fig. 5, the terminal may further include an input-output device 507.
The memory 503 may be used to store software programs and modules, such as program instructions/modules corresponding to the data transmission method and apparatus in the embodiments of the present application, and the processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 503, that is, implements the data transmission method described above. The memory 503 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 503 may further include memory located remotely from the processor 501, which may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 505 is used for receiving or sending data via a network, and may also be used for data transmission between the processor and the memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 505 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 505 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Among them, the memory 503 is used to store an application program in particular.
The processor 501 may call the application stored in the memory 503 through the transmission means 505 to perform the following steps:
receiving a first request of a target device, wherein the first request is used for requesting data transmission between the target device and a first cache, and the first cache is a cache indicated by the first request in a plurality of caches belonging to the same type;
searching a first target plug-in matched with a first transmission scheme from a plurality of plug-ins, wherein each plug-in the plurality of plug-ins is matched with one transmission scheme, caches with different transmission schemes exist in the plurality of caches, and the first transmission scheme is the transmission scheme adopted by the first cache;
and completing data transmission between the target equipment and the first cache through the first target plug-in.
The processor 501 is further configured to perform the following steps:
searching a first plug-in matched with a first scheme from a plurality of plug-ins, wherein the first transmission scheme comprises the first scheme, the first target plug-in comprises the first plug-in, and the first scheme is a transmission scheme adopted by a main cache in a first cache; and the number of the first and second electrodes,
and searching a second plug-in matched with the second scheme from the plurality of plug-ins, wherein the first transmission scheme comprises the second scheme, the first target plug-in comprises the second plug-in, and the second scheme is a transmission scheme adopted from the cache in the first cache.
By adopting the embodiment of the application, a method for receiving a first request of a target device is provided, the first request is used for requesting data transmission between the target device and a first cache, and the first cache is a cache indicated by the first request in a plurality of caches belonging to the same type; searching a first target plug-in matched with a first transmission scheme from a plurality of plug-ins, wherein each plug-in the plurality of plug-ins is matched with one transmission scheme, caches with different transmission schemes exist in the plurality of caches, and the first transmission scheme is a transmission scheme adopted by the first cache; and completing data transmission between the target equipment and the first cache through the first target plug-in. The plug-in units of various transmission schemes are packaged into the middleware, the interfaces of each cache are uniformly adapted through the middleware, the interfaces of each cache do not need to be replaced, the technical problem that the complexity of data transmission between the relevant technology and the caches is high can be solved, and the technical effect of reducing the complexity of the data transmission between the relevant technology and the caches is achieved.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 5 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 5 is a diagram illustrating a structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Embodiments of the present application also provide a storage medium. Alternatively, in the present embodiment, the storage medium described above may be used for a program code of a transmission method of the data.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
receiving a first request of a target device, wherein the first request is used for requesting data transmission between the target device and a first cache, and the first cache is a cache indicated by the first request in a plurality of caches belonging to the same type;
searching a first target plug-in matched with a first transmission scheme from a plurality of plug-ins, wherein each plug-in the plurality of plug-ins is matched with one transmission scheme, caches with different transmission schemes exist in the plurality of caches, and the first transmission scheme is the transmission scheme adopted by the first cache;
and completing data transmission between the target equipment and the first cache through the first target plug-in.
Optionally, the storage medium is further arranged to store program code for performing the steps of:
searching a first plug-in matched with a first scheme from a plurality of plug-ins, wherein the first transmission scheme comprises the first scheme, the first target plug-in comprises the first plug-in, and the first scheme is a transmission scheme adopted by a main cache in a first cache; and the number of the first and second electrodes,
and searching a second plug-in matched with the second scheme from the plurality of plug-ins, wherein the first transmission scheme comprises the second scheme, the first target plug-in comprises the second plug-in, and the second scheme is a transmission scheme adopted from the cache in the first cache.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be implemented in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (9)

1. A method for transmitting data, comprising:
receiving a first request of a target device, wherein the first request is used for requesting data transmission between the target device and a first cache, and the first cache is a cache indicated by the first request in a plurality of caches belonging to the same type;
searching a first target plug-in matched with a first transmission scheme from a plurality of plug-ins, wherein each plug-in the plurality of plug-ins is matched with one transmission scheme, caches with different transmission schemes exist in the plurality of caches, and the first transmission scheme is the transmission scheme adopted by the first cache;
completing data transmission between the target equipment and the first cache through the first target plug-in;
after receiving the first request of the target device, the method further comprises:
receiving a third request, wherein the third request is used for requesting to switch a cache to a second cache;
under the condition that the terminal identification carried in the third request is the same as the terminal identification carried in the first request, searching a second target plug-in matched with a second transmission scheme from the plurality of plug-ins, wherein the second transmission scheme is a transmission scheme adopted by the second cache;
and finishing the data transmission between the target equipment and the second cache through the second target plug-in.
2. The method of claim 1, wherein completing, by the first target plug-in, the data transfer between the target device and the first cache comprises:
determining a target interface adopted by the first cache, wherein an interface of any cache in the plurality of caches is obtained by packaging a transmission scheme adopted by the any cache;
and finishing data transmission between the target equipment and the target interface through the first target plug-in.
3. The method of claim 1 or 2, wherein finding the first target plug-in from the plurality of plug-ins that matches the first transmission scheme comprises:
searching a first plug-in matched with a first scheme from the plurality of plug-ins, wherein the first transmission scheme comprises the first scheme, the first target plug-in comprises the first plug-in, and the first scheme is a transmission scheme adopted by a main cache in the first cache; and the number of the first and second electrodes,
and searching a second plug-in matched with a second scheme from the plurality of plug-ins, wherein the first transmission scheme comprises the second scheme, the first target plug-in comprises the second plug-in, and the second scheme is a transmission scheme adopted from the cache in the first cache.
4. The method of claim 1, wherein after receiving the first request from the target device, the method further comprises:
receiving a second request, wherein the second request is used for requesting to execute a cache operation, and the cache operation comprises at least one of master-slave switching, synchronous writing, asynchronous writing and closing of reading and writing of a cache;
and under the condition that the terminal identification carried in the second request is the same as the terminal identification carried in the first request, executing the caching operation on the first cache.
5. The method of claim 1, wherein searching for a second target plug-in from the plurality of plug-ins that matches a second transmission scheme comprises:
searching a third plug-in matched with a third scheme from the plurality of plug-ins, wherein the second transmission scheme comprises the third scheme, the second target plug-in comprises the third plug-in, and the third scheme is a transmission scheme adopted by a main cache in the second cache; and the number of the first and second electrodes,
and searching a fourth plug-in which is matched with a fourth scheme from the plurality of plug-ins, wherein the second transmission scheme comprises the fourth scheme, the second target plug-in comprises the fourth plug-in, and the fourth scheme is a transmission scheme adopted from the cache in the second cache.
6. An apparatus for transmitting data, comprising:
a receiving unit, configured to receive a first request of a target device, where the first request is used to request data transmission between the target device and a first cache, and the first cache is a cache indicated by the first request in multiple caches belonging to a same type;
the system comprises a searching unit, a judging unit and a processing unit, wherein the searching unit is used for searching a first target plug-in matched with a first transmission scheme from a plurality of plug-ins, each plug-in the plurality of plug-ins is matched with one transmission scheme, caches with different transmission schemes exist in the plurality of caches, and the first transmission scheme is a transmission scheme adopted by the first cache;
the transmission unit is used for completing data transmission between the target equipment and the first cache through the first target plug-in;
a receiving unit, further operable to: after receiving the first request of the target device, receiving a third request, wherein the third request is used for requesting to switch the cache to a second cache; under the condition that the terminal identification carried in the third request is the same as the terminal identification carried in the first request, searching a second target plug-in matched with a second transmission scheme from the plurality of plug-ins, wherein the second transmission scheme is a transmission scheme adopted by the second cache; and finishing the data transmission between the target equipment and the second cache through the second target plug-in.
7. The apparatus of claim 6, wherein the transmission unit comprises:
a determining module, configured to determine a target interface used by the first cache, where an interface of any one of the multiple caches is obtained by encapsulating a transmission scheme used by the any one cache;
and the transmission module is used for finishing data transmission between the target equipment and the target interface through the first target plug-in.
8. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 5.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any of the preceding claims 1 to 5 by means of the computer program.
CN201911122460.0A 2019-11-15 2019-11-15 Data transmission method and device, storage medium and electronic device Active CN111143083B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911122460.0A CN111143083B (en) 2019-11-15 2019-11-15 Data transmission method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911122460.0A CN111143083B (en) 2019-11-15 2019-11-15 Data transmission method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN111143083A CN111143083A (en) 2020-05-12
CN111143083B true CN111143083B (en) 2022-06-07

Family

ID=70517105

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911122460.0A Active CN111143083B (en) 2019-11-15 2019-11-15 Data transmission method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN111143083B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546708A (en) * 2010-12-27 2012-07-04 阿里巴巴集团控股有限公司 Plug-in obtaining method and system as well as relevant devices
CN108322521A (en) * 2018-01-17 2018-07-24 腾讯科技(深圳)有限公司 Message content method for pushing, device, system, computer equipment and storage medium
CN109729116A (en) * 2017-10-30 2019-05-07 腾讯科技(深圳)有限公司 Transmission method, device, storage medium and the electronic device of plugin information

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753293A (en) * 2019-01-08 2019-05-14 深圳市网心科技有限公司 A kind of processing method and relevant device of plug-in unit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546708A (en) * 2010-12-27 2012-07-04 阿里巴巴集团控股有限公司 Plug-in obtaining method and system as well as relevant devices
CN109729116A (en) * 2017-10-30 2019-05-07 腾讯科技(深圳)有限公司 Transmission method, device, storage medium and the electronic device of plugin information
CN108322521A (en) * 2018-01-17 2018-07-24 腾讯科技(深圳)有限公司 Message content method for pushing, device, system, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111143083A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
CN104866383B (en) Interface calling method and device and terminal
CN112328435B (en) Method, device, equipment and storage medium for backing up and recovering target data
US10554604B1 (en) Low-load message queue scaling using ephemeral logical message topics
CN107016027A (en) The method and apparatus for realizing business information fast search
CN101896889B (en) Radio terminal, radio terminal nonvolatile memory, and diagnosis information fail-safe storage method
US8893272B2 (en) Method and device for recombining runtime instruction
CN103858111B (en) A kind of realization is polymerized the shared method, apparatus and system of virtual middle internal memory
CN102779244B (en) Method and device for carrying out file operation
CN110334297A (en) Loading method, terminal, server and the storage medium of terminal page
CN106598692A (en) Method for creating mirror image file in logical volume and starting virtual machine, and server
CN109710185A (en) Data processing method and device
CN100476726C (en) Resource limited equipment and data accessing method
CN112615759B (en) Full link voltage measurement assembly, full link voltage measurement method and device
CN109213498A (en) A kind of configuration method and server of internet web front-end
CN103716346A (en) Management method and device of application on android handset client
CN108345462A (en) The method and apparatus of component upgrade
CN107526608A (en) A kind of OTA AKUs upgrade method and equipment
CN111803917A (en) Resource processing method and device
CN108182119A (en) Read and write abruption control method and device, storage medium and electronic device
CN110417579B (en) Method, equipment and readable medium for managing gigabit network by using gigabit network card
CN111143083B (en) Data transmission method and device, storage medium and electronic device
CN107463638A (en) File sharing method and equipment between offline virtual machine
CN104375832A (en) Underlying hardware shielding device and method for computer
CN107276998A (en) A kind of performance optimization method and device based on OpenSSL
CN105144073A (en) Removable storage device identity and configuration information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant before: Jingdong Digital Technology Holding Co.,Ltd.

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

GR01 Patent grant
GR01 Patent grant