CN112416951A - Data transmission method and device, computer storage medium - Google Patents

Data transmission method and device, computer storage medium Download PDF

Info

Publication number
CN112416951A
CN112416951A CN201910773311.4A CN201910773311A CN112416951A CN 112416951 A CN112416951 A CN 112416951A CN 201910773311 A CN201910773311 A CN 201910773311A CN 112416951 A CN112416951 A CN 112416951A
Authority
CN
China
Prior art keywords
hash value
target field
target
page
identifier
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.)
Granted
Application number
CN201910773311.4A
Other languages
Chinese (zh)
Other versions
CN112416951B (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.)
Beijing Jingdong Qianshi Technology Co Ltd
Original Assignee
Beijing Jingdong Qianshi Technology 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 Beijing Jingdong Qianshi Technology Co Ltd filed Critical Beijing Jingdong Qianshi Technology Co Ltd
Priority to CN201910773311.4A priority Critical patent/CN112416951B/en
Publication of CN112416951A publication Critical patent/CN112416951A/en
Application granted granted Critical
Publication of CN112416951B publication Critical patent/CN112416951B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06F16/2308Concurrency control
    • G06F16/2336Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps
    • G06F16/2343Locking methods, e.g. distributed locking or locking implementation details
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • 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)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a data transmission method and device and a computer storage medium, and relates to the technical field of computers. The data transmission method comprises the following steps: determining the identification of each source page, the identification of the target page and at least one target field name corresponding to the target page under the condition of jumping from at least one source page to the target page; according to the identification of each source page, acquiring each target field name and a target field value corresponding to each target field name from each source page; for each target field name, the following steps are performed: locking the identification of each source page and the name of each target field; and writing the identifier of each source page, the identifier of the target page, the name of each target field and the corresponding relation of the target field value corresponding to each target field name into a memory. According to the method and the device, when the shared data is used by the plurality of source pages, the read-write correctness of the shared data can be ensured, and the occurrence of dirty data is avoided.

Description

Data transmission method and device, computer storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data transfer method and apparatus, and a computer-readable storage medium.
Background
Most of existing warehouse operation software adopts a C/S mode, and utilizes WPF (Windows Presentation Foundation) framework design, so that a plurality of pages can be opened simultaneously by user operation, and data needs to be transmitted among the pages. In the prior art, mostly, a target page static constant is adopted, or a memory static constant is adopted as a medium to store data, or a disk file stores data, when jumping from a plurality of source pages to a target page, a target field value corresponding to a target field name is directly obtained according to the target field name corresponding to the target page, and different target field values corresponding to the same target field name in the plurality of source pages cannot be obtained.
Disclosure of Invention
The inventor thinks that: in the related data transfer method, only a single source page can use shared data, and dirty data occurs when a plurality of source pages use shared data.
In view of the above technical problems, the present disclosure provides a solution, which can ensure the read-write correctness of shared data and avoid the occurrence of dirty data when a plurality of source pages use the shared data.
According to a first aspect of the present disclosure, there is provided a data transfer method, including: determining the identification of each source page, the identification of the target page and at least one target field name corresponding to the target page under the condition of jumping from at least one source page to the target page; according to the identification of each source page, acquiring each target field name and a target field value corresponding to each target field name from each source page; for each target field name, the following steps are performed: locking the identification of each source page and the name of each target field; and writing the identifier of each source page, the identifier of the target page, the name of each target field and the corresponding relation of the target field value corresponding to each target field name into a memory.
In some embodiments, locking the identification of each source page and each target field name comprises: respectively calculating the identifier of each source page, the identifier of the target page and the hash value of each target field name to obtain a first hash value of the identifier of each source page, a second hash value of the identifier of the target page and a third hash value of each target field name; and locking the first hash value of the identifier of each source page and the third hash value of each target field name.
In some embodiments, writing the correspondence between the identifier of each source page, the identifier of the target page, the name of each target field, and the target field value corresponding to each target field name into a memory includes: and writing the corresponding relation of the first hash value of the identifier of each source page, the second hash value, the third hash value of each target field name and the target field value corresponding to the third hash value of each target field name into a memory.
In some embodiments, writing the correspondence between the first hash value of the identifier of each source page, the second hash value, the third hash value of each destination field name, and the destination field value corresponding to the third hash value of each destination field name into the memory includes: replacing the current field value corresponding to the third hash value of each target field name in the memory with the target field value corresponding to the third hash value of each target field name under the condition that the corresponding relationship among the first hash value, the second hash value and the third hash value of each target field name of the identifier of each source page exists in the memory; and under the condition that the corresponding relation among the first hash value, the second hash value and the third hash value of each target field name of the identifier of each source page does not exist in the memory, directly storing the corresponding relation among the first hash value, the second hash value, the third hash value and the target field value corresponding to the third hash value of each target field name of each source page into the memory.
In some embodiments, the data transfer method further comprises: and unlocking the identification of each source page and the name of each target field.
In some embodiments, unlocking the identification of each source page and each target field name comprises: and unlocking the first hash value of the identifier of each source page and the third hash value of each target field name.
In some embodiments, locking the identified first and third hash values of each source page comprises: and locking the first hash value of the identifier of each source page and the third hash value of each target field name by using the reentrant lock.
In some embodiments, locking the identified first hash value of each source page and the third hash value of each destination field name comprises: locking the first hash value of the identifier of each source page and the third hash value of each destination field name under the condition that neither the first hash value of the identifier of each source page nor the third hash value of each destination field name is executed; and under the condition that the first hash value of the identifier of each source page or the third hash value of each target field name is executed, locking the first hash value of the identifier of each source page and the third hash value of each target field name after the operation is finished.
In some embodiments, the operation includes at least one of a read operation and a write operation.
In some embodiments, after writing the correspondence between the identifier of each source page, the identifier of the target page, the name of each target field, and the target field value corresponding to each target field name into the memory, the data transfer method further includes: acquiring the identifier of each source page corresponding to the identifier of the target page from the memory; for the identifier of each source page, reading a target field value corresponding to each target field name corresponding to the identifier of each source page from the memory; and transmitting the target field value corresponding to the identifier of each source page to the target page.
In some embodiments, after writing the correspondence between the first hash value of the identifier of each source page, the second hash value, the third hash value of each destination field name, and the destination field value corresponding to the third hash value of each destination field name into the memory, the method further includes: acquiring each first hash value corresponding to the second hash value from the memory; for each first hash value, reading a target field value corresponding to each third hash value corresponding to each first hash value from the memory; and transmitting the target field value corresponding to each first hash value to the target page.
In some embodiments, passing the target field value corresponding to each first hash value to the target page includes: generating a target field value list according to the target field value corresponding to each first hash value; and transmitting the target field value list to the target page.
In some embodiments, after reading the target field value corresponding to each third hash value corresponding to each first hash value from the memory, the method further includes: for each third hash value, locking said each first hash value and said each third hash value; and deleting the corresponding relation of each first hash value, each second hash value, each third hash value and the target field value corresponding to each third hash value from the memory.
In some embodiments, locking the each first hash value and the each third hash value comprises: locking the first hash value and the third hash value in the case that neither the first hash value nor the third hash value has been operated; and under the condition that each first hash value or each third hash value is executed, locking each first hash value and each third hash value after the operation is finished.
In some embodiments, the data transfer method further comprises: unlocking the each first hash value and the each third hash value.
In some embodiments, the data transfer method further comprises: for each first hash value, generating null data as a target field value corresponding to each first hash value when the first hash value corresponding to the second hash value does not exist in the memory or a third hash value corresponding to the first hash value corresponding to the second hash value does not exist in the memory.
In some embodiments, the data transfer method further comprises: and displaying the target field value corresponding to each first hash value on the target page.
According to a second aspect of the present disclosure, there is provided a data transfer apparatus comprising: the determining module is configured to determine an identifier of each source page, an identifier of the target page and at least one target field name corresponding to the target page under the condition of jumping from at least one source page to the target page; the first acquisition module is configured to acquire each target field name and a target field value corresponding to each target field name from each source page according to the identifier of each source page; a locking module configured to lock, for each target field name, the identity of each source page and each target field name; and the writing module is configured to write the identifier of each source page, the identifier of the target page, the corresponding relation between each target field name and the target field value corresponding to each target field name into a memory for each target field name. In some embodiments, the data transfer device further comprises: a second obtaining module, configured to obtain, from the memory, identifiers of source pages corresponding to the identifiers of the target pages; the reading module is configured to read a target field value corresponding to each target field name corresponding to the identifier of each source page from the memory for the identifier of each source page; and the transfer module is configured to transfer the target field values corresponding to the identifications of the source pages to the target page.
According to a third aspect of the present disclosure, there is provided a data transfer apparatus comprising: a memory; and a processor coupled to the memory, the processor configured to perform the data transfer method of any of the above embodiments based on instructions stored in the memory.
According to a fourth aspect of the present disclosure, a computer-storable medium has stored thereon computer program instructions which, when executed by a processor, implement the data transfer method of any of the above embodiments.
In the embodiment, when the shared data is used by the plurality of source pages, the read-write correctness of the shared data can be ensured, and the occurrence of dirty data is avoided.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The present disclosure may be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
FIG. 1 illustrates a flow diagram of a data transfer method of some embodiments of the present disclosure;
FIG. 2 illustrates a bundle data model of some embodiments of the present disclosure;
FIG. 3 shows a flow diagram of a data transfer method of further embodiments of the present disclosure;
FIG. 4 illustrates a flow diagram of a data transfer method of yet further embodiments of the present disclosure;
FIG. 5 illustrates a block diagram of a data transfer device of some embodiments of the present disclosure;
FIG. 6 shows a block diagram of a data transfer device of further embodiments of the present disclosure;
FIG. 7 illustrates a block diagram of a data transfer device in accordance with further embodiments of the present disclosure;
FIG. 8 illustrates a block diagram of a computer system for implementing some embodiments of the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Fig. 1 illustrates a flow diagram of a data transfer method of some embodiments of the present disclosure.
As shown in fig. 1, the data transfer method includes steps S100 to S130. In some embodiments, the data transfer method is performed by a data transfer device. In some embodiments, the data transfer method is applied to a window-based program or system. For example, a window-based program or system includes a program or system designed using the WPF framework.
Specifically, steps S100-S130 are performed by the data storage portal of the data delivery apparatus. For example, step S100 to step S130 are implemented using the acquisition rule w (o, d, k, v). o is the identifier of the source page, d is the identifier of the target page, k is at least one target field name corresponding to the target page d, and v includes a target field value corresponding to each target field name. The parameter o is a type (type) of the source page, i.e. an identifier of the source page, and a value in the WPF is this. The parameter d is the type (type) of the target page. It should be understood that in WPF typeof (target page) can get the unique identification d of the target page. typeof is a function in WPF for obtaining the type of a page, i.e. the unique identification of the page. And each target field name and the target field value corresponding to each target field name are all of character string types. In some embodiments, the acquisition rule may be implemented through an interface. For example, the respective target field names and the target field value corresponding to each target field name constitute target data corresponding to the target page.
In step S100, when jumping from at least one source page to a destination page, an identifier of each source page, an identifier of the destination page, and at least one destination field name corresponding to the destination page are determined.
In step S110, according to the identifier of each source page, each target field name and a target field value corresponding to each target field name are obtained from each source page.
The data transfer method further includes performing steps 120 to S130 for each target field name.
In step S120, the identity of each source page and each target field name are locked.
Locking the identity of each source page and each target field name is accomplished, for example, as follows.
Firstly, respectively calculating the mark of each source page, the mark of each target page and the hash value of each target field name to obtain a first hash value of the mark of each source page, a second hash value of the mark of each target page and a third hash value of each target field name.
Then, the first hash value of the identification of each source page and the third hash value of each destination field name are locked. For example, the first hash value of the identification of each source page and the third hash value of each destination field name are locked using a reentrant lock. For example, reentrant locks are implemented in Java using Synchronized keywords.
The method and the device utilize the uniqueness of the hash value, adopt a mode of locking the hash value to reduce memory conflict, avoid using excessive locks to control program sequence operation, and reduce performance cost. Furthermore, the use of the reentrant lock can reduce the performance cost, especially reduce the consumption of CPU resources and program congestion when the concurrency is large, compared with the general locking method.
In some embodiments, the first hash value of the identification of each source page and the third hash value of each destination field name are locked in the event that neither the first hash value of the identification of each source page nor the third hash value of each destination field name is being performed. In other embodiments, in the case where the first hash value of the identification of each source page or the third hash value of each destination field name is performed, after waiting for the completion of the operation, the first hash value of the identification of each source page and the third hash value of each destination field name are locked. For example, the operation includes at least one of a read operation and a write operation.
In step S130, the correspondence between the identifier of each source page, the identifier of each target page, the name of each target field, and the value of each target field corresponding to each target field is written into the memory.
In some embodiments, the correspondence between the identifier of each source page, the identifier of each target page, the name of each target field, and the target field value corresponding to each target field name is written into the memory in the form of a bundle data model as shown in fig. 2.
FIG. 2 illustrates a bundle data model of some embodiments of the present disclosure.
As shown in fig. 2, the identifier of each target page in the bundle data model may correspond to identifiers of a plurality of source pages, and the identifiers of the plurality of source pages are stored in the memory in the form of a queue according to the triggering sequence from the source page to the target page. The identification of each source page corresponding to the identification of each target page corresponds to a plurality of data. Each data includes each target field name and a target field value corresponding to each target field name. For example, the source page 1 corresponding to the target page 1 corresponds to a plurality of data such as data 1 and data 2. A plurality of data is stored, for example, in a Map structure. Map structure i.e. (key, value) form. key is the name of the target field and value is the value of the target field. In the present disclosure, for example, data 1 is (target field name 1, target field value 1). In some embodiments, the target field value is data in the form of a string.
It should be appreciated that the identification of a source page can uniquely identify a source page and the identification of a target page can uniquely identify a target page. It should be understood by those skilled in the art that, in addition to using the bundle data model to store the identifier of each source page, the identifier of the target page, each target field name, and the target field value corresponding to each target field name, the bundle data model may also be used to store the correspondence of the first hash value of the identifier of each source page, the second hash value of the identifier of the target page, the third hash value of each target field name, and the target field value corresponding to the third hash value of each target field name.
Returning to fig. 1, the description of step S130 is continued. For example, the correspondence relationship between the identifier of each source page, the identifier of each target page, the name of each target field, and the value of the target field corresponding to each target field is written into the memory as follows. And writing the corresponding relation of the first hash value, the second hash value, the third hash value of each target field name and the target field value corresponding to the third hash value of each target field name of the identifier of each source page into the memory.
In some embodiments, writing the correspondence between the first hash value of the identifier of each source page, the second hash value, the third hash value of each target field name, and the target field value corresponding to the third hash value of each target field name into the memory includes the following two cases.
And under the condition that the corresponding relation of the first hash value, the second hash value and the third hash value of each target field name of the identifier of each source page exists in the memory, replacing the current field value corresponding to the third hash value of each target field name in the memory with the target field value corresponding to the third hash value of each target field name. It should be understood that the current field value corresponding to the third hash value of each target field name is an existing field value in the memory.
And under the condition that the corresponding relation of the first hash value, the second hash value and the third hash value of each target field name of the identifier of each source page does not exist in the memory, directly storing the corresponding relation of the first hash value, the second hash value, the third hash value and the target field value corresponding to the third hash value of each target field name of each source page into the memory.
In some embodiments, the data transfer method further comprises unlocking the identification of each source page and each target field name. Unlocking the identity of each source page and each target field name is achieved, for example, by unlocking the first hash value of the identity of each source page and the third hash value of each target field name.
FIG. 3 shows a flow diagram of a data transfer method of further embodiments of the present disclosure.
As shown in fig. 3, the data transfer method includes steps S100 to S160. Fig. 3 differs from fig. 1 in that fig. 3 shows steps S140 to S160 of the data transfer method of further embodiments. Only the differences between fig. 3 and fig. 1 will be described below, and the same parts will not be described again. For example, the data transfer method is performed by a data transfer apparatus. Specifically, steps S140 to S160 are performed by the data acquisition portal of the data delivery apparatus. For example, steps S140 to S160 are implemented with the reading rule r (d, k). d is the mark of the target page, and k is at least one target field name corresponding to the target page. In some embodiments, the read rules may be implemented through an interface.
It should be understood that the identifiers of each source page, the identifiers of the target pages, the names of each target field and the names of the target fields corresponding to each target field have been written into the memory in steps S100 to S130. After the corresponding relationship between the identifier of each source page, the identifier of the target page, the name of each target field, and the target field value corresponding to each target field is written into the memory, steps S140 to S160 are performed.
In step S140, the identifier of each source page corresponding to the identifier of the target page is obtained from the memory.
In step S150, for the identifier of each source page, the target field value corresponding to each target field name corresponding to the identifier of each source page is read from the memory.
In step S160, the target field value corresponding to the identifier of each source page is passed to the target page. In some embodiments, the data transfer method further includes displaying a target field value corresponding to the identification of each source page with the target page.
Fig. 4 illustrates a flow diagram of a data transfer method of further embodiments of the present disclosure.
As shown in fig. 4, the data transfer method includes steps S100 to S160'. Fig. 4 differs from fig. 1 in that fig. 4 shows steps S140 '-S160' of a data transfer method of yet further embodiments. Only the differences between fig. 4 and fig. 1 will be described below, and the same parts will not be described again.
It should be understood that steps S100-S130 have written the first hash value of the identifier of each source page, the second hash value of the identifier of the destination page, the third hash value of each destination field name, and the destination field name corresponding to the third hash value of each destination field name into the memory. After the corresponding relationship of the first hash value, the second hash value, the third hash value of each target field name and the target field value corresponding to the third hash value of each target field name of the identifier of each source page is written into the memory, step S140 '-step S160' is performed.
In step S140', each first hash value corresponding to the second hash value is obtained from the memory.
In step S150', for each first hash value, a target field value corresponding to each third hash value corresponding to each first hash value is read from the memory.
In step S160', the target field value corresponding to each first hash value is passed to the target page. In some embodiments, the data transfer method further includes displaying the target field value corresponding to each first hash value on the target page.
For example, the transfer of the target field value corresponding to each first hash value to the target page is implemented as follows.
Firstly, a target field value list is generated according to the target field value corresponding to each first hash value. The list of target field values is then passed to the target page.
In some embodiments, the data transfer method further comprises: and for each first hash value, generating null data as a target field value corresponding to each first hash value under the condition that each first hash value corresponding to the second hash value does not exist in the memory or a third hash value corresponding to each first hash value corresponding to the second hash value does not exist in the memory.
In some embodiments, after reading the target field value corresponding to each third hash value corresponding to each first hash value from the memory, the data transfer method further includes:
first, for each third hash value, each first hash value and each third hash value are locked. For example, each first hash value and each third hash value is locked with a reentrant lock. In some embodiments, locking each first hash value and each third hash value includes the following two cases.
And locking each first hash value and each third hash value in the case that each first hash value and each third hash value are not operated. And under the condition that each first hash value or each third hash value is executed, locking each first hash value and each third hash value after the operation is finished. For example, the operation includes at least one of a read operation and a write operation.
And then, deleting the corresponding relation among each first hash value, each second hash value, each third hash value and the target field value corresponding to each third hash value from the memory. In some embodiments, after deleting from memory the correspondence of each first hash value, second hash value, each third hash value, and the target field value to which each third hash value corresponds, the data transfer method further includes unlocking each first hash value and each third hash value. And the memory is cleaned through deletion operation, so that the memory occupation is reduced, and the life cycle of the data is ensured.
Under the condition of jumping from at least one source page to a target page, by using the data transmission method disclosed by the invention, the identifier of each source page, the identifier of the target page, the corresponding relation of each target field name and the target field value corresponding to each target field name can be written into the memory, so that dirty data can not appear when the target field value is obtained from the memory by the target page, namely, under the condition of jumping from at least one source page to the target page, the condition that the target field value corresponding to the target field name in the next source page covers the target field value corresponding to the same target field name in the previous source page can not appear.
For example, in an actual warehouse job, there are often source pages such as a detailed monitoring page of a device or a detailed monitoring page of a task, where the detailed monitoring page of the device includes an execution condition of each device, and the detailed monitoring page of the task monitors the execution condition of each task. The detailed monitor pages of devices or tasks as different source pages will typically have data intersections, i.e., have the same target field name, such as device a. When the actual operator checks the execution condition of the device A, jumping from the detailed monitoring page of the device to the device execution detail page and jumping from the detailed monitoring page of the task to the device execution detail page, wherein the device execution detail page is a target page. The execution of device a may be different in different source pages, i.e. the target field values for the same target field name may be different. According to the data transmission method disclosed by the invention, different target field values of the same target field name of different source pages can be obtained and displayed on the target page without dirty data.
By using the data transmission method disclosed by the invention, the same target field name can exist in a plurality of source pages, and multimode data can be provided in the data sharing process. It should be understood that multimodal data, i.e. the same target field name, may appear in different source pages.
Fig. 5 illustrates a block diagram of a data transfer device of some embodiments of the present disclosure.
As shown in fig. 5, the data transfer device 5 includes: a determination module 50, a first acquisition module 51, a locking module 52 and a writing module 53.
The determining module 50 is configured to determine, in a case of jumping from at least one source page to a destination page, an identifier of each source page, an identifier of the destination page, and at least one destination field name corresponding to the destination page, for example, execute step S100 shown in fig. 1.
The first obtaining module 51 is configured to obtain, according to the identifier of each source page, a respective target field name corresponding to the target page and a target field value corresponding to each target field name from each source page, for example, execute step S110 shown in fig. 1.
And a locking module 52 configured to lock, for each target field name, the identification of each source page and each target field name, for example, to perform step S120 shown in fig. 1.
The writing module 53 is configured to, for each target field name, write the corresponding relationship between the identifier of each source page, the identifier of the target page, each target field name, and the target field value corresponding to each target field name into the memory, for example, execute step S130 shown in fig. 1.
In some embodiments, the data transfer device 5 further includes a second acquisition module 54, a reading module 55, and a transfer module 56.
The second obtaining module 54 is configured to obtain, from the memory, the identifier of each source page corresponding to the identifier of the target page, for example, to execute step S140 shown in fig. 3, or configured to obtain, from the memory, each first hash value corresponding to the second hash value, for example, to execute step S140' shown in fig. 4.
The reading module 55 is configured to, for the identifier of each source page, read, from the memory, a target field value corresponding to each target field name corresponding to the identifier of each source page, for example, execute step S150 shown in fig. 3, or configured to, for each first hash value, read, from the memory, a target field value corresponding to each third hash value corresponding to each first hash value, for example, execute step S150' shown in fig. 4.
The transfer module 56 is configured to transfer the target field value corresponding to the identifier of each source page to the target page, for example, to execute step S160 shown in fig. 3, or configured to transfer the target field value corresponding to each first hash value to the target page, for example, to execute step S160' shown in fig. 4.
In some embodiments, the data transfer apparatus 5 further comprises a data storage module 57 configured to store an identification of each source page, an identification of the target page, a correspondence of each target field name and a target field value corresponding to each target field name, or a correspondence of each first hash value, second hash value, each third hash value and a target field value corresponding to each third hash value.
FIG. 6 shows a block diagram of a data transfer device of further embodiments of the present disclosure.
As shown in fig. 6, the data transfer device 6 includes: a data writing module 61, a data storing module 62, a data reading module 63 and a data deleting module 64.
The data writing module 61 is configured to, in a case of jumping from at least one source page to a target page, write a correspondence between an identifier of each source page, an identifier of the target page, a name of each target field, and a value of the target field corresponding to each target field name into a memory, for example, execute steps S100 to S130 shown in fig. 1.
In some embodiments, the data writing module 61 includes a determination unit 610, a first acquisition unit 611, a write control unit 612, and a writing unit 613.
The determining unit 610 is configured to determine, in a case of jumping from at least one source page to a destination page, an identifier of each source page, an identifier of the destination page, and at least one destination field name corresponding to the destination page, for example, perform step S100 shown in fig. 1.
The first obtaining unit 611 is configured to obtain, from each source page, the respective target field names and the target field value corresponding to each target field name according to the identifier of each source page, for example, to execute step S110 shown in fig. 1.
A write control unit 612 configured to lock the identity of each source page and each target field name, for example, to perform step S120 as shown in fig. 1. In some embodiments, the write control unit 612 is further configured to, for each target field name, unlock the identity of each source page and each target field name.
The writing unit 613 is configured to write the correspondence between the identifier of each source page, the identifier of each target page, the name of each target field, and the value of the target field corresponding to each target field into the memory, for example, execute step S130 shown in fig. 1.
And the data storage module 62 is configured to store the identifier of each source page, the identifier of each target page, the correspondence between each target field name and the target field value corresponding to each target field name, or the correspondence between each first hash value, each second hash value, each third hash value and the target field value corresponding to each third hash value.
The data reading module 63 is configured to read, from the memory, a target field value corresponding to each target field name corresponding to the identifier of each source page corresponding to the identifier of the target page, for example, execute steps S140 to S160 shown in fig. 3. In some embodiments, the data reading module 63 is configured to read the target field value corresponding to each third hash value corresponding to each first hash value corresponding to the second hash value from the memory, for example, execute steps S140 '-S160' as shown in fig. 4.
In some embodiments, the data reading module 63 includes a second obtaining unit 630, a reading unit 631, and a transferring unit 632.
The second obtaining unit 630 is configured to obtain, from the memory, the identifier of each source page corresponding to the identifier of the target page, for example, execute step S140 shown in fig. 3. In some embodiments, the second obtaining unit 630 is configured to obtain each first hash value corresponding to the second hash value from the memory, for example, execute step S140' shown in fig. 4.
The reading unit 631 is configured to, for the identifier of each source page, read, from the memory, a target field value corresponding to each target field name corresponding to the identifier of each source page, for example, execute step S150 shown in fig. 3. In some embodiments, the reading unit 631 is configured to, for each first hash value, read the target field value corresponding to each third hash value corresponding to each first hash value from the memory, for example, execute step S150' as shown in fig. 4.
A transferring unit 632 configured to transfer the target field values corresponding to the identifications of the respective source pages to the target page, for example, execute step S160 shown in fig. 3. In some embodiments, the transferring unit 632 is configured to transfer the target field value corresponding to each first hash value to the target page, for example, execute step S160' as shown in fig. 4.
In some embodiments, the transfer unit 632 includes a generation subunit 632 and a transfer subunit 6322. A generating subunit 6321, configured to generate a target field value list according to the identifier of each source page or the target field value corresponding to each third hash value. A transferring subunit 6322, configured to transfer the identifier of each source page or the target field value list corresponding to each third hash value to the target page.
And the data deleting module 64 is configured to delete each first hash value, each second hash value, each third hash value and the target field value corresponding to each third hash value from the memory, or delete the identifier of each source page, the identifier of the target page, each target field name and the target field value corresponding to each target field name from the memory.
In some embodiments, data deletion module 64 includes a deletion control unit 641 and a deletion unit 642.
A deletion control unit 641 configured to lock or unlock each first hash value and each third hash value for each third hash value.
A deleting unit 642 configured to delete the correspondence between each first hash value, each second hash value, each third hash value, and the target field value corresponding to each third hash value from the memory or delete the correspondence between the identifier of each source page, the identifier of the target page, each target field name, and the target field value corresponding to each target field name from the memory.
Fig. 7 illustrates a block diagram of a data transfer device of further embodiments of the present disclosure.
As shown in fig. 7, the data transfer device 7 includes: a memory 71; and a processor 72 coupled to the memory 71, the memory 71 being configured to store instructions for performing the corresponding embodiment of the data transfer method. The processor 72 is configured to perform the data transfer method in any of the embodiments of the present disclosure based on instructions stored in the memory 71.
FIG. 8 illustrates a block diagram of a computer system for implementing some embodiments of the present disclosure.
As shown in FIG. 8, computer system 80 may take the form of a general purpose computing device. Computer system 80 includes a memory 810, a processor 820, and a bus 800 that connects the various system components.
The memory 810 may include, for example, system memory, non-volatile storage media, and the like. The system memory stores, for example, an operating system, an application program, a Boot Loader (Boot Loader), and other programs. The system memory may include volatile storage media such as Random Access Memory (RAM) and/or cache memory. The non-volatile storage medium stores, for instance, instructions to perform corresponding embodiments of at least one of the data transfer methods. Non-volatile storage media include, but are not limited to, magnetic disk storage, optical storage, flash memory, and the like.
The processor 820 may be implemented as discrete hardware components, such as a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gates or transistors, or the like. Accordingly, each unit, such as the judging unit and the determining unit, may be implemented by a Central Processing Unit (CPU) executing instructions in a memory for performing the corresponding step, or may be implemented by a dedicated circuit for performing the corresponding step.
The bus 800 may use any of a variety of bus architectures. For example, bus structures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, and Peripheral Component Interconnect (PCI) bus.
The computer system 80 may also include an input-output interface 830, a network interface 840, a storage interface 850, and the like. These interfaces 830, 840, 850 and the connection between the memory 88 and the processor 820 may be via a bus 800. The input/output interface 830 may provide a connection interface for input/output devices such as a display, a mouse, and a keyboard. The network interface 840 provides a connection interface for various networking devices. The storage interface 850 provides a connection interface for external storage devices such as a floppy disk, a usb disk, and an SD card.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable apparatus to produce a machine, such that the execution of the instructions by the processor results in an apparatus that implements the functions specified in the flowchart and/or block diagram block or blocks.
These computer-readable program instructions may also be stored in a computer-readable memory that can direct a computer to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart and/or block diagram block or blocks.
The present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects.
By the data transmission method and the device thereof and the computer storage medium in the embodiment, when a plurality of source pages use shared data, the read-write correctness of the shared data can be ensured, the occurrence of dirty data is avoided, and the system performance and the user experience are improved.
So far, the data transfer method, the apparatus thereof, and the computer-storable medium according to the present disclosure have been described in detail. Some details that are well known in the art have not been described in order to avoid obscuring the concepts of the present disclosure. It will be fully apparent to those skilled in the art from the foregoing description how to practice the presently disclosed embodiments.

Claims (21)

1. A method of data transfer, comprising:
determining the identification of each source page, the identification of the target page and at least one target field name corresponding to the target page under the condition of jumping from at least one source page to the target page;
according to the identification of each source page, acquiring each target field name and a target field value corresponding to each target field name from each source page;
for each target field name, the following steps are performed:
locking the identification of each source page and the name of each target field;
and writing the identifier of each source page, the identifier of the target page, the name of each target field and the corresponding relation of the target field value corresponding to each target field name into a memory.
2. The data transfer method of claim 1, wherein locking the identification of each source page and each target field name comprises:
respectively calculating the identifier of each source page, the identifier of the target page and the hash value of each target field name to obtain a first hash value of the identifier of each source page, a second hash value of the identifier of the target page and a third hash value of each target field name;
and locking the first hash value of the identifier of each source page and the third hash value of each target field name.
3. The data transfer method according to claim 2, wherein writing the correspondence between the identifier of each source page, the identifier of the target page, the name of each target field, and the value of the target field corresponding to the name of each target field into a memory comprises:
and writing the corresponding relation of the first hash value of the identifier of each source page, the second hash value, the third hash value of each target field name and the target field value corresponding to the third hash value of each target field name into a memory.
4. The data transfer method according to claim 3, wherein writing the correspondence of the first hash value of the identifier of each source page, the second hash value, the third hash value of each destination field name, and the destination field value corresponding to the third hash value of each destination field name into the memory comprises:
replacing the current field value corresponding to the third hash value of each target field name in the memory with the target field value corresponding to the third hash value of each target field name under the condition that the corresponding relationship among the first hash value, the second hash value and the third hash value of each target field name of the identifier of each source page exists in the memory;
and under the condition that the corresponding relation among the first hash value, the second hash value and the third hash value of each target field name of the identifier of each source page does not exist in the memory, directly storing the corresponding relation among the first hash value, the second hash value, the third hash value and the target field value corresponding to the third hash value of each target field name of each source page into the memory.
5. The data transfer method of claim 3, further comprising: and unlocking the identification of each source page and the name of each target field.
6. The data transfer method of claim 5, unlocking the identification of each source page and each target field name comprising:
and unlocking the first hash value of the identifier of each source page and the third hash value of each target field name.
7. The data transfer method of claim 2, wherein locking the identified first and third hash values for each source page comprises: and locking the first hash value of the identifier of each source page and the third hash value of each target field name by using the reentrant lock.
8. The data transfer method of claim 2, wherein locking the first hash value of the identification of each source page and the third hash value of each destination field name comprises:
locking the first hash value of the identifier of each source page and the third hash value of each destination field name under the condition that neither the first hash value of the identifier of each source page nor the third hash value of each destination field name is executed;
and under the condition that the first hash value of the identifier of each source page or the third hash value of each target field name is executed, locking the first hash value of the identifier of each source page and the third hash value of each target field name after the operation is finished.
9. The data transfer method of claim 8, wherein the operation comprises at least one of a read operation and a write operation.
10. The data transfer method according to claim 1, after writing the correspondence between the identifier of each source page, the identifier of the target page, the name of each target field, and the value of the target field corresponding to the name of each target field into a memory, further comprising:
acquiring the identifier of each source page corresponding to the identifier of the target page from the memory;
for the identifier of each source page, reading a target field value corresponding to each target field name corresponding to the identifier of each source page from the memory;
and transmitting the target field value corresponding to the identifier of each source page to the target page.
11. The data transfer method according to claim 3, after writing the correspondence between the first hash value of the identifier of each source page, the second hash value, the third hash value of each destination field name, and the destination field value corresponding to the third hash value of each destination field name into the memory, further comprising:
acquiring each first hash value corresponding to the second hash value from the memory;
for each first hash value, reading a target field value corresponding to each third hash value corresponding to each first hash value from the memory;
and transmitting the target field value corresponding to each first hash value to the target page.
12. The data transfer method of claim 11, wherein transferring the target field value corresponding to each first hash value to the target page comprises:
generating a target field value list according to the target field value corresponding to each first hash value;
and transmitting the target field value list to the target page.
13. The data transfer method according to claim 11, further comprising, after reading the target field value corresponding to each third hash value corresponding to each first hash value from the memory, the following:
for each third hash value, locking said each first hash value and said each third hash value;
and deleting the corresponding relation of each first hash value, each second hash value, each third hash value and the target field value corresponding to each third hash value from the memory.
14. The data transfer method of claim 13, locking the each first hash value and the each third hash value comprising:
locking the first hash value and the third hash value in the case that neither the first hash value nor the third hash value has been operated;
and under the condition that each first hash value or each third hash value is executed, locking each first hash value and each third hash value after the operation is finished.
15. The data transfer method of claim 13, further comprising: unlocking the each first hash value and the each third hash value.
16. The data transfer method of claim 11, further comprising:
for each first hash value, generating null data as a target field value corresponding to each first hash value when the first hash value corresponding to the second hash value does not exist in the memory or a third hash value corresponding to the first hash value corresponding to the second hash value does not exist in the memory.
17. The data transfer method of claim 11, further comprising:
and displaying the target field value corresponding to each first hash value on the target page.
18. A data transfer apparatus comprising:
the determining module is configured to determine an identifier of each source page, an identifier of the target page and at least one target field name corresponding to the target page under the condition of jumping from at least one source page to the target page;
the first acquisition module is configured to acquire each target field name and a target field value corresponding to each target field name from each source page according to the identifier of each source page;
a locking module configured to lock, for each target field name, the identity of each source page and each target field name;
and the writing module is configured to write the identifier of each source page, the identifier of the target page, the corresponding relation between each target field name and the target field value corresponding to each target field name into a memory for each target field name.
19. The data transfer apparatus of claim 17, further comprising:
a second obtaining module, configured to obtain, from the memory, identifiers of source pages corresponding to the identifiers of the target pages;
the reading module is configured to read a target field value corresponding to each target field name corresponding to the identifier of each source page from the memory for the identifier of each source page;
and the transfer module is configured to transfer the target field values corresponding to the identifications of the source pages to the target page.
20. A data transfer apparatus comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the data transfer method of any of claims 1 to 17 based on instructions stored in the memory.
21. A computer-storable medium having stored thereon computer program instructions which, when executed by a processor, implement a data transfer method as claimed in any one of claims 1 to 17.
CN201910773311.4A 2019-08-21 2019-08-21 Data transfer method and device and computer storage medium Active CN112416951B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910773311.4A CN112416951B (en) 2019-08-21 2019-08-21 Data transfer method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910773311.4A CN112416951B (en) 2019-08-21 2019-08-21 Data transfer method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN112416951A true CN112416951A (en) 2021-02-26
CN112416951B CN112416951B (en) 2024-03-01

Family

ID=74780037

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910773311.4A Active CN112416951B (en) 2019-08-21 2019-08-21 Data transfer method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN112416951B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6990480B1 (en) * 2000-09-18 2006-01-24 Trancept Limited Information manager method and system
CN101039332A (en) * 2007-03-15 2007-09-19 华为技术有限公司 Method, system and server for transmitting page data
US20070288718A1 (en) * 2006-06-12 2007-12-13 Udayakumar Cholleti Relocating page tables
US7996406B1 (en) * 2008-09-30 2011-08-09 Symantec Corporation Method and apparatus for detecting web-based electronic mail in network traffic
US20120159081A1 (en) * 2010-12-15 2012-06-21 Symantec Corporation Deduplication-aware page cache
CN103885829A (en) * 2014-04-16 2014-06-25 中国科学院软件研究所 Virtual machine cross-data-center dynamic migration optimization method based on statistics
CN104040533A (en) * 2012-01-09 2014-09-10 国际商业机器公司 Data sharing using difference-on-write
CN106991008A (en) * 2016-01-20 2017-07-28 华为技术有限公司 A kind of resource lock management method, relevant device and system
CN107733989A (en) * 2017-09-18 2018-02-23 上海斐讯数据通信技术有限公司 The method and system of data information transfer between a kind of current page
CN107766499A (en) * 2017-10-19 2018-03-06 广州视睿电子科技有限公司 A kind of method for page jump, device, equipment and storage medium
CN109766082A (en) * 2017-11-09 2019-05-17 北京京东尚科信息技术有限公司 The method and apparatus that the application program page jumps
CN110020278A (en) * 2017-09-08 2019-07-16 阿里巴巴集团控股有限公司 Displaying, providing method, client and the server of page data

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6990480B1 (en) * 2000-09-18 2006-01-24 Trancept Limited Information manager method and system
US20070288718A1 (en) * 2006-06-12 2007-12-13 Udayakumar Cholleti Relocating page tables
CN101039332A (en) * 2007-03-15 2007-09-19 华为技术有限公司 Method, system and server for transmitting page data
US7996406B1 (en) * 2008-09-30 2011-08-09 Symantec Corporation Method and apparatus for detecting web-based electronic mail in network traffic
US20120159081A1 (en) * 2010-12-15 2012-06-21 Symantec Corporation Deduplication-aware page cache
CN104040533A (en) * 2012-01-09 2014-09-10 国际商业机器公司 Data sharing using difference-on-write
CN103885829A (en) * 2014-04-16 2014-06-25 中国科学院软件研究所 Virtual machine cross-data-center dynamic migration optimization method based on statistics
CN106991008A (en) * 2016-01-20 2017-07-28 华为技术有限公司 A kind of resource lock management method, relevant device and system
CN110020278A (en) * 2017-09-08 2019-07-16 阿里巴巴集团控股有限公司 Displaying, providing method, client and the server of page data
CN107733989A (en) * 2017-09-18 2018-02-23 上海斐讯数据通信技术有限公司 The method and system of data information transfer between a kind of current page
CN107766499A (en) * 2017-10-19 2018-03-06 广州视睿电子科技有限公司 A kind of method for page jump, device, equipment and storage medium
CN109766082A (en) * 2017-11-09 2019-05-17 北京京东尚科信息技术有限公司 The method and apparatus that the application program page jumps

Also Published As

Publication number Publication date
CN112416951B (en) 2024-03-01

Similar Documents

Publication Publication Date Title
US10346381B2 (en) Atomic update operations in a data storage system
US20180089110A1 (en) Intents and Locks with Intent
CN111666201A (en) Regression testing method, device, medium and electronic equipment
CN104572917A (en) Method and device for locking data and distributed storage system
CN108733543B (en) Log analysis method and device, electronic equipment and readable storage medium
CN107729341B (en) Electronic device, information inquiry control method, and computer-readable storage medium
US20160063055A1 (en) Method And Apparatus For Improved Database Searching
CN112181479A (en) Method and device for determining difference between code file versions and electronic equipment
CN112416951B (en) Data transfer method and device and computer storage medium
CN109753506B (en) Data distributed storage method, device, terminal and storage medium
CN113867700B (en) Model construction method, display platform, server and storage medium
US20220261489A1 (en) Capability management method and computer device
CN113641628B (en) Data quality detection method, device, equipment and storage medium
CN110990643B (en) GoJS-based complex task visualization method, terminal device and storage medium
CA3089289C (en) System and methods for loading objects from hash chains
WO2017175375A1 (en) Data cleansing system, method, and program
CN112667682A (en) Data processing method, data processing device, computer equipment and storage medium
RU2659492C1 (en) Unification unit with parallel comparison of terms
CN111857883A (en) Page data checking method and device, electronic equipment and storage medium
CN110968566A (en) Migration tool-based domestic application system migration method
US20230237186A1 (en) Access Control Framework For Graph Entities
CN111143232A (en) Method, apparatus and computer program product for storing metadata
CN110879722B (en) Method and device for generating logic schematic diagram and computer storage medium
US20230237095A1 (en) Metadata for Graph Connected Databases
CN110134691B (en) Data verification 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