Data sharing method, device, equipment, medium and program product
By using coordination components for data sharing in multi-card systems, cross-domain problems and the lack of automatic response mechanisms are solved, and instant synchronization and efficient sharing of data are achieved.
Patent Information
- Application Number
- CN202111029202.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-02
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-09-02
AI Technical Summary
There is a cross-domain problem in data sharing between multiple card systems. The front-end cache does not support cross-domain storage, resulting in increased call complexity, limited data volume, and no automatic response mechanism, so the latest data cannot be obtained in real time.
Through coordinated components for data sharing, the first card system stores the target data set. The second card system obtains the target data by monitoring or rotating inquiries, and modify the initial data according to the target data. Push to the front page.
The cross -domain problems are solved, and the data of the data is realized without the need for additional deployment architecture support, which improves the timeliness and synchronization speed of data sharing.
Smart Images

Figure CN113704670B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and more specifically to a data sharing method, device, equipment, medium and program product. Background Art
[0002] Cards refer to tabs for different areas of services provided by the website system on large websites. There are system interactions or data linkages between multiple cards, that is, the system front-end page of a card needs to be processed and utilized based on the data of other card systems.
[0003] In one example, the card system saves the data that needs to be shared with external services in the front-end local cache such as localstorage. When a page of card system A needs to access data of card system B, it is directly read through the front-end cache.
[0004] However, since each card system is generally an independent microservice system with independent load balancing and bound to an independent domain name, and most front-end caches do not support cross-domain storage, there are cross-domain problems, which increases the complexity of calls. In addition, this data sharing method results in too little shareable data due to the small front-end cache. At the same time, the front-end needs to obtain the latest data through regular page refresh polling or the user's forced refresh of the page in the browser, and cannot automatically obtain changed data. Summary of the invention
[0005] In view of the above problems, the present disclosure provides a data sharing method, apparatus, device, medium and program product.
[0006] According to a first aspect of the present disclosure, a data sharing method is provided, which is applied to a multi-card system, wherein the multi-card system includes a first card system and a second card system, and the method includes:
[0007] The first card system stores the target data centrally;
[0008] The second card system obtains the target data by means of monitoring or polling through the coordination component;
[0009] The second card system modifies the initial data according to the target data,
[0010] The coordination component includes a first coordination component, a second coordination component and a third coordination component, and each coordination component is provided with a client.
[0011] According to an embodiment of the present disclosure, the first card system centrally stores the target data including:
[0012] Determine a target file path according to the target data;
[0013] The target data is published to any node of the first coordination component according to the target file path.
[0014] According to an embodiment of the present disclosure, the second card system acquires the target data by means of monitoring or polling through a coordination component, including:
[0015] The second card system obtains the target data by monitoring the client.
[0016] According to an embodiment of the present disclosure, the second card system acquires the target data by monitoring the client, including:
[0017] The second card system monitors the target path through the client;
[0018] When it is monitored that the target data in the target path changes, the target data is acquired.
[0019] According to an embodiment of the present disclosure, the first card system centrally stores the target data further comprising:
[0020] The target data is saved in any node of the second coordination component according to the preset interface parameter definition.
[0021] According to an embodiment of the present disclosure, the second card system acquires the target data by means of monitoring or polling through a coordination component, including:
[0022] monitoring the coordination data of the second coordination component through the client;
[0023] The target data is determined according to the coordination data, the service cluster ID and the data key.
[0024] According to an embodiment of the present disclosure, the first card system centrally stores the target data further comprising:
[0025] The first card system saves the target data into a database corresponding to the first card system;
[0026] defining a service to output the target data; and
[0027] The service is registered in a service list of any node of the third coordination component.
[0028] According to an embodiment of the present disclosure, the second card system acquires the target data by means of monitoring or polling through a coordination component, including:
[0029] Create scheduled tasks;
[0030] The scheduled task is executed regularly to obtain the target data.
[0031] According to an embodiment of the present disclosure, the periodically executing the scheduled task to obtain the target data includes:
[0032] Acquire the service list from a client of the third coordination component;
[0033] Determine the service address of outputting target data according to the service list;
[0034] The service address is called periodically to obtain the target data.
[0035] According to an embodiment of the present disclosure, after the second card system modifies the initial data according to the target data, it further includes:
[0036] Use websocket technology to push updated data to the front-end page.
[0037] According to an embodiment of the present disclosure, the method of using the websocket technology to push the updated data to the front-end page includes:
[0038] Establish a websocket connection with the front-end interface;
[0039] The updated data is pushed to the front-end page via the websocket connection.
[0040] A second aspect of the present disclosure provides a data sharing device, provided with a multi-card system, the multi-card system including a first card system and a second card system, including: a storage module for the first card system to centrally store target data;
[0041] A monitoring module, used for the second card system to monitor the coordination component through the coordination component client; and
[0042] An updating module, used for the second card system to modify the initial data according to the target data;
[0043] The coordination component includes a first coordination component, a second coordination component and a third coordination component, and each coordination component is provided with a client.
[0044] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned data sharing method.
[0045] The fourth aspect of the present disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned data sharing method.
[0046] The fifth aspect of the present disclosure also provides a computer program product, including a computer program, which implements the above-mentioned data sharing method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0048] Figure 1A A schematic diagram of a front-end solution for sharing card system data provided in this embodiment;
[0049] Figure 1B A schematic diagram of a storage layer solution for sharing card system data provided in this embodiment;
[0050] Figure 1C A schematic diagram of a backend solution for sharing card system data provided in this embodiment;
[0051] Figure 2 A schematic diagram of a system architecture of data sharing according to an embodiment of the present disclosure is shown;
[0052] Figure 3 A flowchart of a data sharing method according to an embodiment of the present disclosure is schematically shown;
[0053] Figure 4A A flowchart of a method for sharing data by a first coordination component according to an embodiment of the present disclosure is schematically shown;
[0054] Figure 4B A system architecture diagram schematically shows a first coordination component sharing data according to an embodiment of the present disclosure;
[0055] Figure 5A A flowchart of a method for sharing data by a second coordination component according to an embodiment of the present disclosure is schematically shown;
[0056] Figure 5B A system architecture diagram schematically shows a second coordination component sharing data according to an embodiment of the present disclosure;
[0057] Fig. 6A A flowchart of a method for sharing data by a third coordination component according to an embodiment of the present disclosure is schematically shown;
[0058] Figure 6B A system architecture diagram schematically shows a third coordination component sharing data according to an embodiment of the present disclosure;
[0059] Figure 7 A structural block diagram schematically shows a data sharing device according to an embodiment of the present disclosure; and
[0060] Figure 8 A block diagram of an electronic device suitable for implementing a data sharing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0061] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0062] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0063] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0064] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0065] In order to help those skilled in the art better understand the technical content of the present disclosure, firstly, a brief introduction is given to the technical background of the method for sharing data in a multi-card system in the prior art.
[0066] In the current multi-card system, due to the huge and complex business, each card is actually generally an independent microservice system or a business system cluster composed of multiple microservices, rather than multiple modules sharing a process. In many cases, there are system interactions or data linkages between multiple cards, that is, the system front-end page of a certain card needs to be processed and utilized based on the data of other card systems. These data acquisitions generally have the following characteristics:
[0067] 1. The volume of a single data record is small, but the overall data volume may be large.
[0068] 2. Data is read more frequently.
[0069] 3. All operations are read-only, and there is no write operation. That is, the modification of the data originally belonging to each card system is the responsibility of the original card system background.
[0070] 4. A certain degree of lag is allowed, and data that needs to maintain strong consistency is generally maintained by the system itself.
[0071] Figure 1A A schematic diagram of a front-end solution for sharing card system data provided in this embodiment; Figure 1B A schematic diagram of a storage layer solution for card system data sharing provided in this embodiment; Figure 1C A schematic diagram of a backend solution for sharing card system data provided in this embodiment.
[0072] In an example, there are generally three ways to share data between cards:
[0073] Front-end solution: Each card system stores the data that needs to be shared with external services in the front-end local cache such as localstorage. Figure 1A As shown, when a page of card system A needs to access data of card system B, it is directly read through the front-end cache. The advantage of this solution is that the call is particularly simple when there is no cross-domain problem; there is no additional deployment cost. However, since most front-end caches, such as cookies, do not support cross-domain storage, when cross-domain issues are involved, it is necessary to use various common cross-domain techniques such as ajax and iframe to circumvent cross-domain restrictions, which greatly increases the complexity of the call; due to the size limit of the front-end cache, the amount of data that can be shared is greatly limited; there is no automatic response mechanism, and the front-end needs to obtain the latest data through the timed refresh polling of the page or the customer's forced refresh of the page in the browser, and the changed data cannot be automatically obtained.
[0074] Storage layer solutions: such as Figure 1BAs shown, each card system will store the data that needs to be accessed and shared with the outside world in addition to storing it in the system itself, and also copying a copy of it and centrally storing it in a separate storage system, called the "shared centralized storage layer". This storage system is not limited to various common solutions in the industry, such as relational databases, memory databases, and file databases. The backend of each "card" system can actively access the shared data it needs through the client API of the storage system. When a "card" system needs to access the data of other "card" systems, the "card" front-end page calls the backend interface through ajax, and the backend interface accesses the "shared centralized storage layer" to obtain data and pass it to the front-end. The advantage of this solution is that the programming call by application developers is relatively simple. However, due to the need to deploy a new storage system, the deployment cost is increased, and this solution also has no automatic response mechanism.
[0075] Backend solutions: such as Figure 1C As shown in the figure, a message queue for data transmission is established between the card systems that need to share data to transmit the data that needs to be changed. When the front-end page of a card system needs to access certain shared data, a request will be initiated from the page to the back-end to request the data to be displayed. The back-end solution also has the problems of deployment cost and no automatic response mechanism.
[0076] In order to solve the above problem and realize the problem of data sharing between multiple card systems, an embodiment of the present disclosure provides a data sharing method, which is applied to the multiple card system, wherein the multiple card system includes a first card system and a second card system, and is characterized in that the method includes:
[0077] The first card system stores the target data centrally; the second card system obtains the target data by listening or polling through the coordination component; the second card system modifies the initial data according to the target data, wherein the coordination component includes a first coordination component, a second coordination component and a third coordination component, and each coordination component is provided with a client.
[0078] Figure 2 The following schematically shows the system architecture diagram of data sharing according to the embodiment of the present disclosure. It should be noted that: Figure 2 The system architecture shown is only an example of an application scenario and system architecture that can be used in the embodiments of the present disclosure, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. It should be noted that the data sharing method provided in the embodiments of the present disclosure can be used in related aspects of the financial field, and can also be used in any field other than the financial field. The application field of the data sharing method and device provided in the embodiments of the present disclosure is not limited.
[0079] like Figure 2As shown in the figure, in the microservice framework of the multi-card system, in the process of service provision and consumption, the collaborative work of many nodes in the distributed system is generally completed by coordination components. Common coordination components include ZooKeeper, Eureka and Nacos. All application nodes detect possible data changes of a node in the coordination component by listening or polling to complete their own state processing; or write a value to a node in the coordination component to notify other application nodes of the change. The application service provider cluster acts as a service provider, directly stores the data to be shared in the coordination component, or defines a service that outputs shared data, and registers the service in the coordination component, and realizes data sharing and synchronization through the consistency of the coordination component. This solves the problem of no automatic response mechanism and cross-domain access in the existing technology.
[0080] It should be understood that Figure 2 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0081] The following will be based on Figure 2 The system architecture described by Figure 3 to Figure 8 The data sharing method of the disclosed embodiment is described in detail.
[0082] Figure 3 The flowchart of the data sharing method according to the embodiment of the present disclosure is schematically shown.
[0083] like Figure 3 As shown, the data sharing method of this embodiment includes operations S210 to S230, and the method can be executed by a server or a background system.
[0084] In operation S210, the first card system centrally stores the target data.
[0085] In one example, a multi-card system includes at least a first card system A and a second card system B. There is data linkage between card system A and card system B, that is, the system front-end page of a certain card needs to be processed and utilized based on the data of other card systems. These data that need to be shared are target data. In the prior art, the sharing of target data faces cross-domain problems, and there is no automatic response mechanism, and it is impossible to achieve instant synchronization of data. In the embodiment of the present disclosure, taking the sharing of data from the first card system A to the second card system B as an example, first, the first card system A needs to centrally store the target data, and the storage method can be stored in the node of the distributed system coordination component, or in the persistence layer database.
[0086] In operation S220, the second card system obtains target data through the coordination component in a monitoring or polling manner.
[0087] According to an embodiment of the present disclosure, the coordination component includes a first coordination component, a second coordination component and a third coordination component, and each coordination component is provided with a client.
[0088] In one example, the coordinated work of many nodes in a distributed system is generally carried out by coordination components. When card system A stores new target data, the nodes of the coordination component in the second card system B obtain the new target data by listening or polling according to the characteristics of the coordination component itself. When the coordination component is the first coordination component ZooKeeper or the second coordination component Nacos, since the first coordination component and the second coordination component have the characteristics of a dynamic configuration center and a service registration center, the target data is directly stored in the dynamic configuration center, and the client of the coordination component actively monitors the changes in the target data from card system A through event monitoring; when the coordination component is the third coordination component Eureka, since Eureka only has the characteristics of a service registration center, it cannot store target data, and the target data is stored in the persistence layer database. At this time, card system B needs to establish a scheduled task to poll the target data in card system A to update the target data regularly.
[0089] In operation S230, the second card system modifies the initial data according to the target data.
[0090] The second card system B modifies and updates the initial data according to the target data obtained in operation S220 to complete data synchronization. Similarly, when the data is updated in the card system B, the card system A obtains the new target data in the same way to achieve data sharing.
[0091] According to the data sharing method provided in the embodiment of the present disclosure, based on the original system architecture, the strong consistency of the coordination component is used to realize data sharing between multiple card systems, avoiding cross-domain problems during data calls, and no additional deployment architecture support is required, thereby improving the speed of data sharing synchronization.
[0092] Figure 4A The following schematically shows a flow chart of a method for sharing data by a first coordination component according to an embodiment of the present disclosure. Figure 4B The system architecture diagram of the first coordination component sharing data according to an embodiment of the present disclosure is schematically shown.
[0093] like Figure 4A As shown, when the coordination component is Zookeeper, it specifically includes operations S310 to S340.
[0094] In operation S310, a target file path is determined according to target data.
[0095] In operation S320, the target data is published to any node of the first coordination component according to the target file path.
[0096] In an example, Figure 4B As shown, the microservice in the card system A publishes the target data to be shared to the first coordination component ZooKeeper through the API. The data to be published includes at least the service cluster ID, data key, and data value, where the service cluster ID is used to identify the target data source. According to the characteristics of the tree file storage structure of ZooKeeper, the target file path saved in ZooKeeper is " / cardshare / service cluster ID / data key / data value".
[0097] In operation S330, the second card system acquires target data by monitoring the client.
[0098] According to the embodiment of the present disclosure, the second card system monitors the target path through the client; when it is monitored that the target data in the target path changes, the target data is acquired.
[0099] In one example, the backend of the card system that needs to use shared data establishes an additional monitoring of the coordination component of the card system that provides shared data through the client to monitor changes in specific data. For example, card system B can monitor specific shared data in the ZooKeeper cluster of card system A. When using ZooKeeper, the backend system of card system B monitors the following path through the ZooKeeper client:
[0100] Card system A: / cardshare / card system A cluster ID / data key / data value.
[0101] When the shared data of card system A changes, the background of system B can obtain the changed value immediately.
[0102] In operation S340, the second card system modifies the initial data according to the target data.
[0103] The technical solution principle and operation of S340 Figure 3 The operation S230 shown is the same and will not be described in detail.
[0104] Figure 5A The following schematically shows a flow chart of a method for sharing data by a second coordination component according to an embodiment of the present disclosure. Figure 5B The system architecture diagram of the second coordination component sharing data according to an embodiment of the present disclosure is schematically shown.
[0105] like Figure 5A As shown, when the coordination component is Nacos, it specifically includes operations S410 to S440.
[0106] In operation S410, target data is saved in any node of the second coordination component according to a preset interface parameter definition.
[0107] like Figure 5B As shown in the figure, when the coordination component is Nacos, its own database will be used to store the target data that needs to be shared. According to the interface parameter definition, the shared target data also needs to include the service cluster ID, data key, and data value.
[0108] In operation S420, coordination data of the second coordination component is monitored by the client.
[0109] In an example, the coordination data contains a service list (various microservices registered in the coordination component) and some configuration data. When the data of a node of a coordination component changes, the coordination data will be sent to other nodes to ensure data synchronization of each node. Card system B can obtain coordination data by adding the listener provided by the Nacos client.
[0110] In operation S430, target data is determined according to the coordination data, the service cluster ID, and the data key.
[0111] By monitoring the service cluster ID and data key, the listener supports setting callback functions to handle changes in the monitored data.
[0112] In operation S440, the second card system modifies the initial data according to the target data.
[0113] The technical solution principle and operation of S440 Figure 3 The operation S230 shown is the same and will not be described in detail.
[0114] Fig. 6A The following schematically shows a flow chart of a method for sharing data by a third coordination component according to an embodiment of the present disclosure. Figure 6B A system architecture diagram for sharing data with a third coordination component according to an embodiment of the present disclosure is schematically shown.
[0115] like Fig. 6A As shown, when the coordination component is Eureka, it specifically includes operations S510 to S550.
[0116] In operation S510 , the first card system saves the target data into a database corresponding to the first card system.
[0117] In operation S520, a service is defined to output target data.
[0118] In operation S530, the service is registered in a service list of any node of the third coordination component.
[0119] Operation S510 to Operation S530 are the processes of the first card system A centrally storing the target data. When the microservice cluster uses Eureka as a coordination component, since Eureka only has the function of a service registration and discovery center, it cannot store data as a dynamic configuration center. Therefore, the card system that needs to provide target data needs to define an interface for obtaining the target data and register the interface on Eureka.
[0120] In operation S540, a scheduled task is established.
[0121] In operation S550 , a scheduled task is periodically executed to obtain target data.
[0122] According to an embodiment of the present disclosure, the scheduled task specifically includes obtaining a service list from a client of the third coordination component; determining a service address for outputting target data according to the service list; and regularly calling the service address to obtain the target data.
[0123] In an example, Figure 6B As shown in the figure, since Eureka can only exist as a service registration and discovery center, when the shared data changes, but the address of the service function itself does not change, Eureka's listening client will not receive any change notification. Therefore, the card system that uses shared data needs to establish a scheduled task to call such services regularly to obtain the latest shared data.
[0124] After card system B obtains the target data synchronized by card system A, that is, after operation S230, operation S340, operation S440, and operation S550, it also includes operation S610 and operation S620. In operation S610, a websocket connection is established with the front-end interface; in operation S620, the updated data is pushed to the front-end page through the websocket connection.
[0125] In an example, after card system B obtains the target data synchronized by card system A, the target data is only stored in the background system at this time, and the synchronized target data needs to be notified to the front-end page. The disclosed embodiment adopts websocket technology to push the latest target data directly to the front-end page. After receiving the notification from the websocket, the front-end page updates and displays the page data, completing the automatic update process of shared data of the card system.
[0126] According to the data sharing method provided by the embodiment of the present disclosure, the target data of the card system is acquired by the coordination component in a listening or polling manner to achieve rapid data synchronization. The synchronized target data is pushed to the front-end page through the websocket technology to achieve automatic update of the shared data of the card system, thereby solving the data sharing problem between the microservices of the card system and improving the timeliness of data sharing.
[0127] Based on the above data sharing method, the present disclosure also provides a data sharing device. Figure 7 The device is described in detail.
[0128] Figure 7 The structure block diagram of the data sharing device according to the embodiment of the present disclosure is schematically shown.
[0129] like Figure 7 As shown, the data sharing device 700 of this embodiment is provided with a multi-card system, the multi-card system includes a first card system and a second card system, and includes a storage module 710 , a monitoring module 720 and an updating module 730 .
[0130] The storage module 710 is used for the first card system to centrally store the target data. In one embodiment, the storage module 710 can be used to perform the operation S210 described above, which will not be described in detail here.
[0131] The monitoring module 720 is used for the second card system to monitor the coordination component through the coordination component client. In one embodiment, the monitoring module 720 can be used to perform the operation S220 described above, which will not be repeated here.
[0132] The update module 730 is used for the second card system to modify the initial data according to the target data. The coordination component includes a first coordination component, a second coordination component and a third coordination component, and each coordination component is provided with a client. In one embodiment, the update module 730 can be used to perform the operation S230 described above, which will not be repeated here.
[0133] According to an embodiment of the present disclosure, any multiple modules of the storage module 710, the monitoring module 720 and the update module 730 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the storage module 710, the monitoring module 720 and the update module 730 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the storage module 710, the monitoring module 720 and the update module 730 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0134] Figure 8 A block diagram of an electronic device suitable for implementing a data sharing method according to an embodiment of the present disclosure is schematically shown.
[0135] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0136] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in one or more memories.
[0137] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage portion 808 as needed.
[0138] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0139] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.
[0140] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the data sharing method provided by the embodiment of the present disclosure.
[0141] The above functions defined in the system / device of the embodiment of the present disclosure are executed when the computer program is executed by the processor 801. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0142] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0143] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0144] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0145] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0146] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0147] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data sharing method, applied to a multi-card system, wherein the multi-card system comprises a first card system and a second card system, characterized in that: The method comprises: The first card system stores the target data centrally; The second card system obtains the target data by means of monitoring or polling through the coordination component; The second card system modifies the initial data according to the target data, The coordination component includes a first coordination component, a second coordination component and a third coordination component, each coordination component is provided with a client, The second card system acquires the target data by means of monitoring or polling through the coordination component, including: The second card system obtains the target data by monitoring the client, wherein the second card system obtains the target data by monitoring the client includes: The second card system monitors the target path through the client; When it is monitored that the target data in the target path changes, the target data is acquired.
2. The method according to claim 1, characterized in that: The first card system centrally stores the target data including: Determine a target file path according to the target data; The target data is published to any node of the first coordination component according to the target file path.
3. The method according to claim 1, characterized in that The first card system centrally stores the target data and further includes: The target data is saved in any node of the second coordination component according to the preset interface parameter definition.
4. The method according to claim 3, characterized in that The second card system acquires the target data by means of monitoring or polling through the coordination component, including: monitoring the coordination data of the second coordination component through the client; The target data is determined according to the coordination data, the service cluster ID and the data key.
5. The method according to claim 1, characterized in that: The first card system centrally stores the target data and further includes: The first card system saves the target data into a database corresponding to the first card system; defining a service to output the target data; and The service is registered in a service list of any node of the third coordination component.
6. The method according to claim 5, characterized in that The second card system acquires the target data by means of monitoring or polling through the coordination component, including: Create scheduled tasks; The scheduled task is executed regularly to obtain the target data.
7. The method according to claim 6, characterized in that The periodically executing the scheduled task to obtain the target data includes: Acquire the service list from a client of the third coordination component; Determine the service address of outputting target data according to the service list; The service address is called periodically to obtain the target data.
8. The method according to any one of claims 1 to 7, characterized in that: After the second card system modifies the initial data according to the target data, it also includes: Use websocket technology to push updated data to the front-end page.
9. The method according to claim 8, characterized in that The use of websocket technology to push updated data to the front-end page includes: Establish a websocket connection with the front-end interface; The updated data is pushed to the front-end page via the websocket connection.
10. A data sharing device, provided with a multi-card system, the multi-card system comprising a first card system and a second card system, comprising: A storage module, used for the first card system to centrally store target data; A monitoring module, used for the second card system to monitor the coordination component through the coordination component client; as well as An updating module, used for the second card system to modify the initial data according to the target data; The coordination component includes a first coordination component, a second coordination component and a third coordination component, each coordination component is provided with a client, The monitoring module is specifically used for the second card system to monitor the target path through the client; when it is monitored that the target data in the target path changes, the target data is acquired.
11. An electronic device, comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 9.
13. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Webpage table data sharing method and device
CN103678549A