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

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

Info

Publication number
CN112637280B
CN112637280B CN202011439655.0A CN202011439655A CN112637280B CN 112637280 B CN112637280 B CN 112637280B CN 202011439655 A CN202011439655 A CN 202011439655A CN 112637280 B CN112637280 B CN 112637280B
Authority
CN
China
Prior art keywords
data
browser
local
global variable
transmitted
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
CN202011439655.0A
Other languages
Chinese (zh)
Other versions
CN112637280A (en
Inventor
高林龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011439655.0A priority Critical patent/CN112637280B/en
Publication of CN112637280A publication Critical patent/CN112637280A/en
Application granted granted Critical
Publication of CN112637280B publication Critical patent/CN112637280B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of data processing, and discloses a data transmission method, which comprises the following steps: acquiring local data of a browser and global variables defined in the browser, and identifying whether the browser is compatible with a local database; if the first data to be transmitted in the local storage space is not compatible with the local database, storing the local data in a pre-established local storage space, responding to a data application event of a page in a browser, and transmitting the first data to be transmitted in the local storage space to a corresponding browser page after carrying out global variable declaration by utilizing a global variable; if the data to be transmitted is compatible with the local database, storing the local data into the local database, responding to a data application event of a page in the browser, and transmitting the second data to be transmitted of the local database to the corresponding browser page after carrying out global variable statement by utilizing the global variable. Furthermore, the present invention relates to blockchain techniques, where the local data may be stored in the blockchain. The invention can solve the problem of insufficient data transmission and storage space of the browser multi-page application.

Description

Data transmission method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a data transmission method, apparatus, electronic device, and computer readable storage medium.
Background
With the continuous enhancement of the functions of the browser, local data are not required to be stored in the data transmission process of the single-page application in the browser, and the local data of the single-page application in the browser can be directly called, but the local variable data of the multi-page application in the browser cannot be directly transmitted, and are generally stored in a cookie mode and the like to realize the local variable data transmission of the multi-page application.
Disclosure of Invention
The invention provides a data transmission method, a data transmission device, electronic equipment and a computer readable storage medium, and mainly aims to solve the problem of insufficient storage space during data transmission of multi-page application in a browser and reduce the phenomenon of stuck pages of the browser.
In order to achieve the above object, the present invention provides a data transmission method, including:
acquiring local data of a browser and global variables defined in the browser, and identifying whether the browser is compatible with a local database according to the version number of the browser;
if the browser is not compatible with the local database, storing the local data into a pre-created local storage space, responding to a data application event of a page in the browser, reading first data to be transmitted from the local storage space, carrying out global variable declaration on the first data to be transmitted by utilizing the global variable, generating first global variable data, and transmitting the first global variable data to a corresponding browser page;
if the browser is compatible with a local database, storing the local data into the local database, responding to a data application event of a page in the browser, reading second data to be transmitted from the local database, carrying out global variable declaration on the second data to be transmitted by utilizing the global variable, generating second global variable data, and transmitting the second global variable data to a corresponding browser page.
Optionally, the storing the local data in a pre-created local storage space includes:
acquiring a compiling environment of the local storage space, and declaring a data storage variable in the compiling environment;
and storing the local data into the key value of the local storage space according to the data storage variable.
Optionally, the reading the first data to be transmitted from the local storage space in response to the data application event of the page in the browser includes:
triggering a data application event of a page in the browser based on a preset data monitoring mechanism;
and reading the data to be transmitted from the key value of the local storage space according to the data application event to obtain first data to be transmitted.
Optionally, the performing global variable declaration on the first data to be transmitted by using the global variable to generate first global variable data includes:
loading the first data to be transmitted into the compiling environment of the global variable;
and in the compiling environment of the global variable, carrying out global variable declaration on the data to be transmitted by utilizing the global variable to generate first global variable data.
Optionally, after the transmitting the first global variable data to the corresponding browser page, the method further includes:
and monitoring whether the first global variable data is subjected to data updating, if so, updating corresponding first data to be transmitted, and storing the updated first data to be transmitted into the local storage space.
Optionally, the storing the local data in the local database includes:
and loading the local database into the browser, and storing the local data into the local database loaded into the browser according to the data storage transaction created in the local database in advance.
Optionally, the storing the local data in a local database loaded to a browser includes:
the local data is stored in the form of key value pairs into a local database loaded into the browser.
In order to solve the above problems, the present invention also provides a data transmission apparatus, including:
the identification module is used for acquiring the local data of the browser and the global variable defined in the browser, and identifying whether the browser is compatible with a local database or not according to the version number of the browser;
the transmission module is used for storing the local data into a pre-created local storage space when the browser is not compatible with a local database, responding to a data application event of a page in the browser, reading first data to be transmitted from the local storage space, carrying out global variable declaration on the first data to be transmitted by utilizing the global variable, generating first global variable data, and transmitting the first global variable data to a corresponding browser page;
the transmission module is further configured to store the local data in a local database when the browser is compatible with the local database, read second data to be transmitted from the local database in response to a data application event of a page in the browser, perform global variable declaration on the second data to be transmitted by using the global variable, generate second global variable data, and transmit the second global variable data to a corresponding browser page.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to implement the data transmission method described above.
In order to solve the above-described problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the above-described data transmission method.
According to the method, firstly, a storage mode corresponding to local data is selected according to the compatibility of the browser, and the problem of insufficient storage space during data transmission of multi-page application in the browser is solved, so that the response speed of the local data is improved, and the phenomenon of blocking of pages of the browser is reduced; secondly, the invention carries out global variable declaration on the local data by combining with the predefined global variable, thereby solving the problem that the local variable in a single page of the browser can not be transmitted; further, the invention transmits the local data of the global variable declaration to the corresponding browser page, thereby realizing the data transmission of the browser multi-page application. Therefore, the data transmission method, the device, the electronic equipment and the storage medium can solve the problem of insufficient storage space during data transmission of multi-page application in the browser, and reduce the phenomenon of blocking of pages of the browser.
Drawings
Fig. 1 is a flow chart of a data transmission method according to an embodiment of the invention;
FIG. 2 is a detailed flowchart illustrating one of the steps of the data transmission method of FIG. 1 according to the first embodiment of the present invention;
fig. 3 is a detailed flowchart illustrating another step of the data transmission method provided in fig. 1 according to the first embodiment of the present invention;
fig. 4 is a schematic block diagram of a data transmission device according to an embodiment of the invention;
fig. 5 is a schematic diagram of an internal structure of an electronic device for implementing a data transmission method according to an embodiment of the present invention;
the achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides a data transmission method. The execution body of the data transmission method includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiment of the application. In other words, the data transmission method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Referring to fig. 1, a flow chart of a data transmission method according to an embodiment of the present invention is shown. In an embodiment of the present invention, the data transmission method includes:
s1, acquiring local data of a browser and global variables defined in the browser, and identifying whether the browser is compatible with a local database according to the version number of the browser.
The browser refers to an application program for retrieving, displaying and transmitting Web information resources, such as an IE browser, a QQ browser, a fire fox browser and the like. The local data refers to page data displayed in the browser, and the global variable refers to a variable that can be referenced by all objects or functions in the browser.
Further, according to the webpage opened in the browser, the embodiment of the invention utilizes the crawler script to acquire the local data of the corresponding webpage, and utilizes the object function to define the global variable in the browser. Wherein the object function includes global.
Further, the local database refers to a browser database, which is used for storing browser data, and preferably, in the embodiment of the present invention, the local browser is an IndexedDB, and the IndexedDB is created through a web script, such as a JavaScript script.
Further, the identifying whether the browser is compatible with the local database according to the version number of the browser includes: and if the version number does not support the local database, the browser is not compatible with the local database, and if the version number supports the local database, the browser is compatible with the local database.
Further, it is to be stated that the local database has the advantages of large data storage amount, high data query speed and the like, but because the version levels of the browsers are different, not all the browsers support the local database, the implementation of the invention can better select the storage mode of the local data by identifying whether the corresponding browser is compatible with the local database, thereby reducing page blocking of the browser.
Further, to ensure availability and security of the local data, the local data may also be stored in a blockchain node.
And if the browser is not compatible with the local database, executing S2, storing the local data into a pre-created local storage space, responding to a data application event of a page in the browser, reading first data to be transmitted from the local storage space, carrying out global variable statement on the first data to be transmitted by utilizing the global variable, generating first global variable data, and transmitting the first global variable data to a corresponding browser page.
In a preferred implementation of the present invention, if the browser is not compatible with the local database, the local data is stored in a pre-created local storage space, where the pre-created local storage space is created by a localStorage.
In detail, referring to fig. 2, the storing the local data in the pre-created local storage space includes:
s20, acquiring a compiling environment of the local storage space, and declaring a data storage variable in the compiling environment;
s21, according to the data storage variable, the local data are stored into key values (keys) of the local storage space by using a preset storage method.
In the embodiment of the present invention, the compiling environment may be a sublevel, the data storage variable may be a var variable function, and the preset storage method is a localstorage.
Further, in the embodiment of the invention, in response to a data application event of a page in the browser, local data to be transmitted is read from the local storage space, and first data to be transmitted is obtained. For example, in the browser, the local data in the page B needs to be applied to the page a, and the local data in the page B belongs to a local variable and cannot be directly transmitted from the page B to the page a, so that the local data to be transmitted in the page B is read from a local storage space according to a data application event triggering the page a, thereby guaranteeing the data transmission precondition of the local variable in the page B.
Specifically, the reading, in response to the data application event of the page in the browser, the first data to be transmitted from the local storage space includes: triggering a data application event of a page in the browser based on a preset data monitoring mechanism; and according to the data application event, reading the data to be transmitted from the key value of the local storage space by using a preset data reading method to obtain first data to be transmitted.
The data monitoring mechanism is compiled through java language and is used for monitoring data application events of pages in the browser.
The preset data reading method comprises the following steps: var naid = localstorage.
Because the first data to be transmitted belongs to a local variable and cannot be transmitted in a plurality of pages of the browser, the embodiment of the invention uses the global variable to update the data to be transmitted and generate updated data so as to realize the multi-page transmission of the first data to be transmitted.
In detail, referring to fig. 3, the performing global variable declaration on the first data to be transmitted by using the global variable to generate first global variable data includes:
s30, loading the first data to be transmitted into a compiling environment of the global variable;
s31, in the compiling environment of the global variable, carrying out global variable declaration on the data to be transmitted by utilizing the global variable to generate first global variable data.
Illustratively, the first data to be transmitted is X and Y, the global variable is global, the X and Y are transmitted to a compiling environment of the global by using a data transmission tool, global variable declarations (global X, Y) are performed on the X and Y by the global, and the generated X and Y are global variable data.
Further, the embodiment of the invention further includes, after transmitting the first global variable data to the corresponding browser page: and monitoring whether the first global variable data is updated or not through a variable subscription mechanism, if the first global variable data is updated, updating corresponding first data to be transmitted, and storing the updated first data to be transmitted into the local storage space so as to facilitate the next transmission of the first data to be transmitted directly from the local storage space.
Further, according to the data application event of the page in the browser, the embodiment of the invention transmits the first global variable data to the corresponding browser page.
And if the browser is compatible with a local database, executing S3, storing the local data into the local database, responding to a data application event of a page in the browser, reading second data to be transmitted from the local database, carrying out global variable statement on the second data to be transmitted by utilizing the global variable, generating second global variable data, and transmitting the second global variable data to a corresponding browser page.
In a preferred embodiment of the present invention, the storing the local data in the local database includes:
and loading the local database into a corresponding browser, and storing the local data into the local database loaded into the browser according to the data storage transaction created in the local database in advance.
Wherein, the loading of the local database is carried out in a lasting form; the data storage Transaction is created by a Transaction.
In the embodiment of the present invention, the storage form of storing the local data in the local database is a key-value pair (key-value) form.
Further, the reading the second data to be transmitted from the local database in response to the data application event of the page in the browser includes: triggering a data application event of a page in the browser based on a preset data monitoring mechanism; and reading the local data to be transmitted from the local database according to the data application event and a preset data reading transaction to obtain second data to be transmitted.
The data monitoring mechanism is compiled through java language and is used for monitoring data application events of pages in the browser.
The preset data reading transaction comprises the following steps: the embodiment of the invention uses the method of the object store in the transaction to execute the reading of the local data.
The preferred implementation of the invention utilizes the global variable to carry out global variable declaration on the second data to be transmitted, generates second global variable data and transmits the second global variable data to the corresponding browser page. The execution principle of performing global variable declaration on the second data to be transmitted by using the global variable may refer to the execution principle of performing global variable declaration on the first data to be transmitted by using the global variable, which is not further described herein.
Further, the embodiment of the invention further includes, after transmitting the second global variable data to the corresponding browser page: and monitoring whether the second global variable data is updated or not through a variable subscription mechanism, if the second global variable data is updated, updating the corresponding second data to be transmitted, and storing the updated second data to be transmitted into the local database so as to facilitate the next transmission of the second data to be transmitted directly from the local database.
As shown in fig. 4, a functional block diagram of the data transmission device of the present invention is shown.
The data transmission device 100 of the present invention may be installed in an electronic apparatus. The data transmission means may comprise an identification module 101 and a transmission module 102, depending on the function implemented. The module of the present invention may also be referred to as a unit, meaning a series of computer program segments capable of being executed by the processor of the electronic device and of performing fixed functions, stored in the memory of the electronic device.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the identifying module 101 is configured to obtain local data of a browser and global variables defined in the browser, and identify whether the browser is compatible with a local database according to a version number of the browser.
The browser refers to an application program for retrieving, displaying and transmitting Web information resources, such as an IE browser, a QQ browser, a fire fox browser and the like. The local data refers to page data displayed in the browser, and the global variable refers to a variable that can be referenced by all objects or functions in the browser.
Further, according to the webpage opened in the browser, the embodiment of the invention utilizes the crawler script to acquire the local data of the corresponding webpage, and utilizes the object function to define the global variable in the browser. Wherein the object function includes global.
Further, the local database refers to a browser database, which is used for storing browser data, and preferably, in the embodiment of the present invention, the local browser is an IndexedDB, and the IndexedDB is created through a web script, such as a JavaScript script.
Further, the identifying module 101 identifies whether the browser is compatible with the local database according to the version number of the browser, and the identifying module performs the following steps: and if the version number does not support the local database, the browser is not compatible with the local database, and if the version number supports the local database, the browser is compatible with the local database.
Further, it is to be stated that the local database has the advantages of large data storage amount, high data query speed and the like, but because the version levels of the browsers are different, not all the browsers support the local database, the implementation of the invention can better select the storage mode of the local data by identifying whether the corresponding browser is compatible with the local database, thereby reducing page blocking of the browser.
Further, to ensure availability and security of the local data, the local data may also be stored in a blockchain node.
The transmission module 102 is configured to store the local data in a local storage space created in advance when the browser is not compatible with the local database, read first data to be transmitted from the local storage space in response to a data application event of a page in the browser, perform global variable declaration on the first data to be transmitted by using the global variable, generate first global variable data, and transmit the first global variable data to a corresponding browser page.
In a preferred implementation of the present invention, if the browser is not compatible with the local database, the local data is stored in a pre-created local storage space, where the pre-created local storage space is created by a localStorage.
In detail, the storing the local data in a pre-created local storage space, the transmitting module 102 performs the following manner: acquiring a compiling environment of the local storage space, and declaring a data storage variable in the compiling environment; and according to the data storage variable, storing the local data into a key value (key) of the local storage space by using a preset storage method.
In the embodiment of the present invention, the compiling environment may be a sublevel, the data storage variable may be a var variable function, and the preset storage method is a localstorage.
Further, the transmission module 102 reads the local data to be transmitted from the local storage space in response to the data application event of the page in the browser, so as to obtain the first data to be transmitted. For example, in the browser, the local data in the page B needs to be applied to the page a, and the local data in the page B belongs to a local variable and cannot be directly transmitted from the page B to the page a, so that the local data to be transmitted in the page B is read from a local storage space according to a data application event triggering the page a, thereby guaranteeing the data transmission precondition of the local variable in the page B.
Specifically, in response to the data application event of the page in the browser, the transmission module 102 reads the first data to be transmitted from the local storage space, and performs the following manner: triggering a data application event of a page in the browser based on a preset data monitoring mechanism; and according to the data application event, reading the data to be transmitted from the key value of the local storage space by using a preset data reading method to obtain first data to be transmitted.
The data monitoring mechanism is compiled through java language and is used for monitoring data application events of pages in the browser.
The preset data reading method comprises the following steps: var naid = localstorage.
Because the first data to be transmitted belongs to a local variable and cannot be transmitted in a plurality of pages of the browser, the embodiment of the invention uses the global variable to update the data to be transmitted and generate updated data so as to realize the multi-page transmission of the first data to be transmitted.
In detail, the global variable declaration is performed on the first data to be transmitted by using the global variable to generate first global variable data, and the transmission module 102 performs the following steps:
step I, loading the first data to be transmitted into a compiling environment of the global variable;
and II, in the compiling environment of the global variable, carrying out global variable declaration on the data to be transmitted by using the global variable to generate first global variable data.
Illustratively, the first data to be transmitted is X and Y, the global variable is global, the X and Y are transmitted to a compiling environment of the global by using a data transmission tool, global variable declarations (global X, Y) are performed on the X and Y by the global, and the generated X and Y are global variable data.
Further, the transmitting module 102 further includes, after transmitting the first global variable data to the corresponding browser page: and monitoring whether the first global variable data is updated or not through a variable subscription mechanism, if the first global variable data is updated, updating corresponding first data to be transmitted, and storing the updated first data to be transmitted into the local storage space so as to facilitate the next transmission of the first data to be transmitted directly from the local storage space.
Further, according to the data application event of the page in the browser, the embodiment of the invention transmits the first global variable data to the corresponding browser page.
The transmission module 102 is further configured to store the local data in a local database when the browser is compatible with the local database, read second data to be transmitted from the local database in response to a data application event of a page in the browser, perform global variable declaration on the second data to be transmitted by using the global variable, generate second global variable data, and transmit the second global variable data to a corresponding browser page.
In the preferred embodiment of the present invention, the storing the local data in the local database is performed by the transmission module 102 in the following manner:
and loading the local database into a corresponding browser, and storing the local data into the local database loaded into the browser according to the data storage transaction created in the local database in advance.
Wherein, the loading of the local database is carried out in a lasting form; the data storage Transaction is created by a Transaction.
In the embodiment of the present invention, the storage form of storing the local data in the local database is a key-value pair (key-value) form.
Further, in response to the data application event of the page in the browser, the second data to be transmitted is read from the local database, and the transmission module 102 performs the following manner: triggering a data application event of a page in the browser based on a preset data monitoring mechanism; and reading the local data to be transmitted from the local database according to the data application event and a preset data reading transaction to obtain second data to be transmitted.
The data monitoring mechanism is compiled through java language and is used for monitoring data application events of pages in the browser.
The preset data reading transaction comprises the following steps: the embodiment of the invention uses the method of the object store in the transaction to execute the reading of the local data.
In a preferred embodiment of the present invention, the transmission module 102 performs global variable declaration on the second data to be transmitted by using the global variable, generates second global variable data, and transmits the second global variable data to a corresponding browser page. The execution principle of performing global variable declaration on the second data to be transmitted by using the global variable may refer to the execution principle of performing global variable declaration on the first data to be transmitted by using the global variable, which is not further described herein.
Further, in the embodiment of the present invention, after transmitting the second global variable data to the corresponding browser page, the transmitting module 102 further includes: and monitoring whether the second global variable data is updated or not through a variable subscription mechanism, if the second global variable data is updated, updating the corresponding second data to be transmitted, and storing the updated second data to be transmitted into the local database so as to facilitate the next transmission of the second data to be transmitted directly from the local database.
Fig. 5 is a schematic structural diagram of an electronic device for implementing the data transmission method according to the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a data transmission program 12, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may in other embodiments also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes for data transmission, but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects respective components of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device 1 and processes data by running or executing programs or modules (e.g., performing data transmission, etc.) stored in the memory 11, and calling data stored in the memory 11.
The bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
Fig. 5 shows only an electronic device with components, it being understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for supplying power to each component, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
Further, the electronic device 1 may also comprise a network interface, optionally the network interface may comprise a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the electronic device 1 and other electronic devices.
The electronic device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The data transmission 12 stored by the memory 11 in the electronic device 1 is a combination of instructions which, when executed in the processor 10, may implement:
receiving a data transmission request, dividing the data transmission request into a plurality of data transmission tasks, sequencing the priority of the data transmission tasks, and submitting the data transmission tasks to a preset waiting queue;
responding to the data transmission event in the waiting queue, and transmitting the data transmission task in the waiting queue to a preset running queue;
dividing the data transmission tasks in the running queue into subtasks to generate data transmission subtasks;
and according to the data transmission subtask, corresponding data transmission is executed from the service system, and a sub data file is obtained.
Specifically, the specific implementation method of the above instructions by the processor 10 may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
Further, the integrated modules/units of the electronic device 1 may be stored in a non-volatile computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. A method of data transmission, the method comprising:
acquiring local data of a browser and global variables defined in the browser, and identifying whether the browser is compatible with a local database according to the version number of the browser;
if the browser is not compatible with the local database, storing the local data into a pre-created local storage space, responding to a data application event of a page in the browser, reading first data to be transmitted from the local storage space, carrying out global variable declaration on the first data to be transmitted by utilizing the global variable, generating first global variable data, and transmitting the first global variable data to a corresponding browser page;
if the browser is compatible with a local database, storing the local data into the local database, responding to a data application event of a page in the browser, reading second data to be transmitted from the local database, carrying out global variable declaration on the second data to be transmitted by utilizing the global variable, generating second global variable data, and transmitting the second global variable data to a corresponding browser page.
2. The data transmission method according to claim 1, wherein the storing the local data into a pre-created local storage space includes:
acquiring a compiling environment of the local storage space, and declaring a data storage variable in the compiling environment;
and storing the local data into the key value of the local storage space according to the data storage variable.
3. The data transmission method according to claim 1, wherein the reading the first data to be transmitted from the local storage space in response to the data application event of the page in the browser includes:
triggering a data application event of a page in the browser based on a preset data monitoring mechanism;
and reading the data to be transmitted from the key value of the local storage space according to the data application event to obtain first data to be transmitted.
4. The data transmission method as claimed in claim 1, wherein said performing global variable declaration on the first data to be transmitted using the global variable, generating first global variable data, includes:
loading the first data to be transmitted into the compiling environment of the global variable;
and in the compiling environment of the global variable, carrying out global variable declaration on the data to be transmitted by utilizing the global variable to generate first global variable data.
5. The method for transmitting data according to claim 4, wherein after transmitting the first global variable data to the corresponding browser page, further comprises:
and monitoring whether the first global variable data is subjected to data updating, if so, updating corresponding first data to be transmitted, and storing the updated first data to be transmitted into the local storage space.
6. The data transmission method according to any one of claims 1 to 5, wherein the storing the local data in the local database includes:
and loading the local database into the browser, and storing the local data into the local database loaded into the browser according to the data storage transaction created in the local database in advance.
7. The method for data transmission according to claim 6, wherein storing the local data in a local database loaded to a browser comprises:
the local data is stored in the form of key value pairs into a local database loaded into the browser.
8. A data transmission apparatus, the apparatus comprising:
the identification module is used for acquiring the local data of the browser and the global variable defined in the browser, and identifying whether the browser is compatible with a local database or not according to the version number of the browser;
the transmission module is used for storing the local data into a pre-created local storage space when the browser is not compatible with a local database, responding to a data application event of a page in the browser, reading first data to be transmitted from the local storage space, carrying out global variable declaration on the first data to be transmitted by utilizing the global variable, generating first global variable data, and transmitting the first global variable data to a corresponding browser page;
the transmission module is further configured to store the local data in a local database when the browser is compatible with the local database, read second data to be transmitted from the local database in response to a data application event of a page in the browser, perform global variable declaration on the second data to be transmitted by using the global variable, generate second global variable data, and transmit the second global variable data to a corresponding browser page.
9. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data transmission method according to any one of claims 1 to 7.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the data transmission method according to any one of claims 1 to 7.
CN202011439655.0A 2020-12-10 2020-12-10 Data transmission method, device, electronic equipment and storage medium Active CN112637280B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011439655.0A CN112637280B (en) 2020-12-10 2020-12-10 Data transmission method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011439655.0A CN112637280B (en) 2020-12-10 2020-12-10 Data transmission method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112637280A CN112637280A (en) 2021-04-09
CN112637280B true CN112637280B (en) 2023-05-05

Family

ID=75309262

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011439655.0A Active CN112637280B (en) 2020-12-10 2020-12-10 Data transmission method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112637280B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391768A (en) * 2017-09-12 2017-11-24 广州酷狗计算机科技有限公司 Web data processing method, device, equipment and computer-readable recording medium
CN109343971A (en) * 2018-08-20 2019-02-15 平安普惠企业管理有限公司 A kind of browser data transmission method and device based on caching technology
CN109522499A (en) * 2018-11-20 2019-03-26 平安科技(深圳)有限公司 Method, apparatus, computer equipment and the storage medium of local loading page data
CN109688202A (en) * 2018-12-04 2019-04-26 北京腾云天下科技有限公司 A kind of processing method of interface data, calculates equipment and storage medium at device
CN111444455A (en) * 2020-03-25 2020-07-24 平安医疗健康管理股份有限公司 Browser compatible method, system, computer device and storage medium
CN112040025A (en) * 2020-09-03 2020-12-04 北京文香信息技术有限公司 Server address switching method, system and terminal equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007122691A (en) * 2005-09-27 2007-05-17 Ns Solutions Corp Information processor, information processing method and program

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391768A (en) * 2017-09-12 2017-11-24 广州酷狗计算机科技有限公司 Web data processing method, device, equipment and computer-readable recording medium
CN109343971A (en) * 2018-08-20 2019-02-15 平安普惠企业管理有限公司 A kind of browser data transmission method and device based on caching technology
CN109522499A (en) * 2018-11-20 2019-03-26 平安科技(深圳)有限公司 Method, apparatus, computer equipment and the storage medium of local loading page data
CN109688202A (en) * 2018-12-04 2019-04-26 北京腾云天下科技有限公司 A kind of processing method of interface data, calculates equipment and storage medium at device
CN111444455A (en) * 2020-03-25 2020-07-24 平安医疗健康管理股份有限公司 Browser compatible method, system, computer device and storage medium
CN112040025A (en) * 2020-09-03 2020-12-04 北京文香信息技术有限公司 Server address switching method, system and terminal equipment

Also Published As

Publication number Publication date
CN112637280A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
CN112506559B (en) Gray release method and device based on gateway, electronic equipment and storage medium
CN113704665B (en) Dynamic service release method and device, electronic equipment and storage medium
CN111694844B (en) Enterprise operation data analysis method and device based on configuration algorithm and electronic equipment
CN112506779A (en) Software interface testing method and device, electronic equipment and storage medium
CN114881616A (en) Business process execution method and device, electronic equipment and storage medium
CN111429121B (en) Block chain-based electronic ticket processing method, device, equipment and storage medium
CN112650909A (en) Product display method and device, electronic equipment and storage medium
CN112256783A (en) Data export method and device, electronic equipment and storage medium
CN114356530A (en) Task scheduling method and device, electronic equipment and storage medium
CN112486490B (en) Front-end code packaging method and device, electronic equipment and storage medium
CN111985194A (en) Data storage method and device, electronic equipment and storage medium
CN112637280B (en) Data transmission method, device, electronic equipment and storage medium
CN113515265B (en) Site configuration method, device, equipment and computer readable storage medium
CN114020414A (en) Symbiotic method and device of Android system and bottom layer Linux, electronic equipment and storage medium
CN112686759A (en) Account checking monitoring method, device, equipment and medium
CN112527282B (en) Front-end page verification method and device, electronic equipment and storage medium
CN113360375B (en) Transaction testing method, device, electronic equipment and storage medium
CN113704109B (en) Front-end and back-end data interaction method and device, electronic equipment and storage medium
CN112631573B (en) Component adding method, device, equipment and computer readable storage medium
CN113362040B (en) Approval chain configuration updating method and device, electronic equipment and storage medium
CN107450946A (en) Chrome webpages and the terminal software means of communication, equipment and storage medium
CN112328960B (en) Optimization method and device for data operation, electronic equipment and storage medium
CN113608779B (en) Service interface configuration method, device, equipment and storage medium
CN114610359A (en) Project upgrading method, device, equipment and medium based on design development framework
CN114185589A (en) Spring boot-based file transmission method, device, equipment and medium

Legal Events

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