Data calling method, device, storage medium and electronic device
By monitoring the changes in database resource data, obtaining and converting it into metadata, and storing it to the server for client to call, it solves the server pressure problem caused by the large amount of network data for content distribution, and realizes efficient utilization of resources.
Patent Information
- Application Number
- CN202111257492.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2041-10-27
AI Technical Summary
The large amount of data on the content distribution network leads to high pressure on servers and waste of hardware resources.
By listening to resource data in the database, obtaining the changed resource data, converting it to obtain metadata, and storing the metadata to the server for client to call.
It reduces the amount of data stored in the database, reduces the pressure on servers, and solves the problem of high server pressure caused by the large amount of data on the content distribution network.
Smart Images

Figure CN114048255B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of databases, and in particular to a data calling method, device, storage medium and electronic device. Background Art
[0002] In the prior art, the data in the database of the content distribution network is usually stored in the MQ server (RabbitMQ) for client calls. However, due to the large amount of data and a lot of invalid data in the content distribution network, the backend service pressure is high and the hardware resources are wasted. Summary of the invention
[0003] The embodiments of the present invention provide a data calling method, device, storage medium and electronic device to at least solve the technical problem of high server pressure caused by large data volume in a content distribution network.
[0004] According to one aspect of an embodiment of the present invention, a data calling method is provided, comprising: monitoring resource data in a database; in the event that the resource data changes, acquiring the changed resource data; converting the changed resource data to obtain metadata of the resource data; and storing the metadata in a server for a client to call the metadata.
[0005] According to another aspect of an embodiment of the present invention, a data calling device is provided, including: a monitoring module for monitoring resource data in a database; an acquisition module for acquiring the changed resource data when the resource data changes; a conversion module for converting the changed resource data to obtain metadata of the resource data; and a storage module for storing the metadata in a server so that a client can call the metadata.
[0006] As an optional example, the above-mentioned acquisition module includes: a first determination unit, which is used to use the above-mentioned second data as the changed resource data when the above-mentioned resource data in the above-mentioned database is updated from the first data to the second data; or when the above-mentioned third data is newly added to the above-mentioned database, use the above-mentioned third data as the changed resource data; or when the fourth data in the above-mentioned database is deleted, use the above-mentioned fourth data as the changed resource data.
[0007] As an optional example, the conversion module includes: a second determination unit, used to determine the table or field corresponding to the resource data; a conversion unit, used to convert the data structure of the resource data into a visual data structure according to the table or the field to obtain the metadata.
[0008] As an optional example, the storage module includes: a third determination unit, used to determine the unique identifier of the metadata; and a storage unit, used to store the unique identifier of the metadata in the server.
[0009] As an optional example, the above-mentioned device also includes: a first determination module, which is used to determine the availability of the calling interface of the above-mentioned server after storing the above-mentioned metadata in the above-mentioned server, when receiving an acquisition request for requesting the above-mentioned metadata, wherein the above-mentioned acquisition request is used to obtain the above-mentioned metadata through the above-mentioned calling interface; a sending module, which is used to return the unique identifier of the above-mentioned metadata in the above-mentioned server when the above-mentioned calling interface is available, so that the above-mentioned client obtains the above-mentioned metadata according to the above-mentioned unique identifier.
[0010] As an optional example, the above-mentioned device also includes: a first adjustment module, which is used to adjust the time interval of the client's periodic polling of the above-mentioned calling interface from the first time interval to the second time interval when the above-mentioned calling interface is available, wherein the second time interval is greater than the first time interval; a second adjustment module, which is used to adjust the time interval of the client's periodic polling of the above-mentioned calling interface from the first time interval to a fixed time interval when the above-mentioned calling interface is unavailable, wherein the fixed time interval is the calling time interval of the client when the above-mentioned calling interface is not connected.
[0011] As an optional example, the apparatus further includes: a second determination module, configured to determine that the calling interface is unavailable when an exception occurs in a listener that monitors the database or a converter that converts the resource data.
[0012] According to another aspect of an embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program executes the above-mentioned data calling method when executed by a processor.
[0013] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the data calling method through the computer program.
[0014] In an embodiment of the present invention, a method is adopted for monitoring resource data in a database; when the resource data changes, the changed resource data is obtained; the changed resource data is converted to obtain metadata of the resource data; and the metadata is stored in a server for a client to call the metadata. In the above method, the system can monitor the changed resource data in the database, convert the changed resource data to obtain metadata, and store the metadata in a server for a client to call, thereby achieving the purpose of reducing the amount of data stored in the database, reducing the pressure on the server, and further solving the technical problem of high pressure on the server caused by the large amount of data in the content distribution network. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0016] Figure 1 is a flow chart of an optional data calling method according to an embodiment of the present invention;
[0017] Figure 2 is a system schematic diagram of an optional data calling method according to an embodiment of the present invention;
[0018] Figure 3 is a data flow diagram of an optional data calling method according to an embodiment of the present invention;
[0019] Figure 4 This is a schematic diagram of a client obtaining metadata according to an optional data calling method according to an embodiment of the present invention;
[0020] Figure 5 This is a schematic diagram of an MQ queue exception of an optional data calling method according to an embodiment of the present invention;
[0021] Figure 6 is a schematic structural diagram of an optional data calling device according to an embodiment of the present invention;
[0022] Figure 7 is a schematic diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] According to a first aspect of an embodiment of the present invention, a data calling method is provided. Optionally, as follows: Figure 1 As shown, the above method includes:
[0026] S102, monitoring resource data in the database;
[0027] S104, when the resource data changes, obtaining the changed resource data;
[0028] S106, converting the changed resource data to obtain metadata of the resource data;
[0029] S108, storing the metadata in the server so that the client can call the metadata.
[0030] Optionally, this embodiment can be applied in the process of pushing resource data of a database to a server for client to call. The database can be a database of core resource data of a content delivery network (CDN), and the server can be an application server, such as an MQ server (RabbitMQ).
[0031] Optionally, in this embodiment, the resource data in the database may be monitored. If the resource data in the database has not changed, the resource data may not be acquired temporarily. If the resource data has changed, the changed resource data may be acquired.
[0032] Optionally, in this embodiment, when monitoring whether the resource data in the database has changed, each piece of data may be monitored to see whether it has changed, and if any piece of data has changed, the changed resource data is acquired. As another example that can be implemented, the data in the database may be scanned once every predetermined time period to scan which resource data has changed and which resource data has not changed.
[0033] After obtaining the changed resource data, the changed data can be converted to obtain metadata of the resource data. Metadata is data that describes data. The metadata in this embodiment is used to describe the changed resource data. After the metadata is converted, the metadata is stored in the server so that the client can call the above metadata. The client can subscribe to the calling interface of the server. After the metadata is stored in the server, the client can obtain the corresponding metadata from the server. After the client obtains the metadata, it can adjust / update the local data according to the metadata.
[0034] Through this embodiment, through the above method, the system can monitor the changed resource data in the database, convert the changed resource data into metadata, and store the metadata in the server for client calls, thereby achieving the purpose of reducing the amount of data stored in the database and reducing the server pressure.
[0035] As an optional example, in the case where the resource data changes, obtaining the changed resource data includes:
[0036] When the resource data in the database is updated from the first data to the second data, the second data is regarded as the changed resource data; or
[0037] When the third data is newly added in the database, the third data is regarded as the changed resource data; or
[0038] When the fourth data in the database is deleted, the fourth data is regarded as the changed resource data.
[0039] Optionally, in this embodiment, during the monitoring process of resource data in the database, if the resource data is updated from the first data to the second data, it is considered that the resource data has changed. The updating from the first data to the second data may be that the original resource data has changed under the operation of the user, the resource data has been modified, and thus the resource data has been updated, resulting in the change of the resource data, or it may be the addition of resource data, such as the database does not contain the third data, but the third data is added, then the third data is considered to be the changed resource data, or if the fourth data in the database is deleted, then the fourth data is also considered to be the changed data.
[0040] As an optional example, the above conversion of the changed resource data to obtain the metadata of the resource data includes:
[0041] Determine the table or field corresponding to the resource data;
[0042] According to the table or field, the data structure of the resource data is converted into a visual data structure to obtain metadata.
[0043] Optionally, in this embodiment, metadata is obtained by converting the changed resource data, so as to determine the table or field to which the changed resource data belongs, thereby generating metadata to describe which data has undergone what kind of changes. In other words, the type, storage location, and content of the changed resource data can be clearly identified through the metadata of the resource data, so that after the client obtains the resource data, it can adjust the resource data according to the metadata.
[0044] As an optional example, the above-mentioned storing metadata in the server includes:
[0045] A unique identifier that identifies metadata;
[0046] The unique identifier of the metadata is stored in the server.
[0047] Optionally, in this embodiment, after determining the changed resource data and converting the resource data to obtain metadata, a unique identifier of the metadata can be determined. The unique identifier can be a unique identity document (ID) for generating metadata, or a label for generating metadata. The unique identifier can distinguish different metadata, and metadata can be obtained based on the unique identifier.
[0048] In this embodiment, the unique identifier of the metadata may be stored in the server for the client to call. After the client calls the unique identifier of the metadata, the metadata may be obtained according to the unique identifier, thereby adjusting the local data according to the metadata.
[0049] As an optional example, after storing the metadata in the server, the method further includes:
[0050] determining availability of a calling interface of the server upon receiving an acquisition request for requesting metadata, wherein the acquisition request is used to acquire metadata through the calling interface;
[0051] When the calling interface is available, the unique identifier of the metadata in the server is returned so that the client can obtain the metadata according to the unique identifier.
[0052] Optionally, in this embodiment, the client can obtain metadata or a unique identifier of metadata by calling a calling interface of the server. The calling interface can have different states, such as an available state and an unavailable state. If the calling interface is in an available state, the client can normally use the calling interface to obtain metadata or obtain a unique identifier of metadata, and then obtain metadata based on the unique identifier.
[0053] As an optional example, the above method further includes:
[0054] When the calling interface is available, adjusting the time interval of the client's scheduled polling calling interface from the first time interval to the second time interval, wherein the second time interval is greater than the first time interval;
[0055] When the calling interface is unavailable, the time interval of the client's scheduled polling calling interface is adjusted from the first time interval to a fixed time interval, wherein the fixed time interval is the calling time interval when the client is not connected to the calling interface.
[0056] Optionally, in this embodiment, if the calling interface is available, when the client uses the calling interface to call metadata, the time interval of the client's scheduled polling calling interface can also be adjusted from the first time interval to the second time interval. The first time interval can be the time interval of the polling calling interface after the client accesses the calling interface and before using the calling interface to obtain metadata. When the client uses the calling interface to call metadata, the time interval is extended to the second time interval, and the second time interval is greater than the first time interval.
[0057] If the calling interface is unavailable, the time interval for the client to poll the calling interface can be adjusted from the first time interval to a fixed time interval. Since the calling interface is unavailable, the client can shorten the polling time interval, so as to use the calling interface to obtain metadata as soon as the calling interface is available.
[0058] As an optional example, the above method further includes:
[0059] In the case where an exception occurs in a listener that monitors the database or a converter that converts resource data, it is determined that the calling interface is unavailable.
[0060] Optionally, whether the calling interface in this embodiment is available depends on whether there is an abnormal condition in the system. For example, whether the listener that monitors the changes in resource data in the database is abnormal, whether the converter that converts the changed resource data is abnormal, etc. If any node is abnormal, it is determined that the calling interface is unavailable. If all nodes are normal, it is determined that the calling interface is available. The above-mentioned nodes may also include nodes such as servers.
[0061] Optionally, the database in this embodiment can be a database of a content delivery network (CDN), and the content delivery network can be an intelligent virtual network built on a traditional basis, relying on edge servers deployed in various places, through the load balancing, content distribution, scheduling and other functional modules of the central platform, so that users can obtain the required content nearby, reduce network congestion, and improve user access response speed and hit rate.
[0062] The resource data in this embodiment may be the central control resource data of the content distribution network. The central control resource data is the data of the basic resources serving the CDN. The central control resource data includes but is not limited to a series of enumerated data such as nodes, devices, and Internet Protocol (IP).
[0063] In this embodiment, a listener can be used to monitor data changes in the mysql database. The listener can be a middleware for monitoring, such as an open source middleware. MySQL is a relational database management system. The listener monitors the data changes in the mysql database, and filters and cleans the data and puts it into the RabbitMQ queue for consumption. The system framework is as follows: Figure 2 shown. Figure 2 In the process, the core application can adjust the core resource data in the database of the main database server through write operations. The Binlog log file is the monitored changed resource data, which is synchronously copied to the server cluster and recorded as a Relay log file, which is executed by the slave node. The distributed application coordination service can maintain high data availability. The resource data is filtered to obtain metadata, and the metadata id is stored in the MQ queue of the MQ server. The client calls the metadata id to obtain the metadata, and adjusts the local data of the client according to the metadata. The data flow is as follows Figure 3 shown.
[0064] Figure 4 A schematic diagram of a client using a calling interface to obtain metadata / metadata ID. Figure 4 In the process, the client requests metadata from the MQ queue of the MQ server. The MQ queue determines the data type, obtains the metadata id, and then calls the central control interface to return the metadata to the client. The client adjusts the local resource data according to the metadata.
[0065] Figure 5There may be an exception in the MQ queue. If the MQ queue is abnormal, the MQ service will be shut down and the client will no longer be able to request metadata. At this time, the client can periodically train the MQ switch. If the MQ switch is turned on, the training interval can be adjusted, such as increasing the interval. If the MO switch is turned off, the local query data service can be changed to the original state, that is, the call frequency before the MQ is connected.
[0066] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0067] According to another aspect of the embodiment of the present application, a data calling device is also provided. Figure 6 As shown, including:
[0068] A monitoring module 602, used for monitoring resource data in a database;
[0069] The acquisition module 604 is used to acquire the changed resource data when the resource data changes;
[0070] The conversion module 606 is used to convert the changed resource data to obtain the metadata of the resource data;
[0071] The storage module 608 is used to store the metadata in the server so that the client can call the metadata.
[0072] Optionally, this embodiment can be applied in the process of pushing resource data of a database to a server for client to call. The database can be a database of core resource data of a content delivery network (CDN), and the server can be an application server, such as an MQ server (RabbitMQ).
[0073] Optionally, in this embodiment, the resource data in the database may be monitored. If the resource data in the database has not changed, the resource data may not be acquired temporarily. If the resource data has changed, the changed resource data may be acquired.
[0074] Optionally, in this embodiment, when monitoring whether the resource data in the database has changed, each piece of data may be monitored to see whether it has changed, and if any piece of data has changed, the changed resource data is acquired. As another example that can be implemented, the data in the database may be scanned once every predetermined time period to scan which resource data has changed and which resource data has not changed.
[0075] After obtaining the changed resource data, the changed data can be converted to obtain metadata of the resource data. Metadata is data that describes data. The metadata in this embodiment is used to describe the changed resource data. After the metadata is converted, the metadata is stored in the server so that the client can call the above metadata. The client can subscribe to the calling interface of the server. After the metadata is stored in the server, the client can obtain the corresponding metadata from the server. After the client obtains the metadata, it can adjust / update the local data according to the metadata.
[0076] Through this embodiment, through the above method, the system can monitor the changed resource data in the database, convert the changed resource data into metadata, and store the metadata in the server for client calls, thereby achieving the purpose of reducing the amount of data stored in the database and reducing the server pressure.
[0077] As an optional example, the acquisition module includes:
[0078] The first determination unit is used to treat the second data as the changed resource data when the resource data in the database is updated from the first data to the second data; or to treat the third data as the changed resource data when the third data is newly added to the database; or to treat the fourth data as the changed resource data when the fourth data in the database is deleted.
[0079] Optionally, in this embodiment, during the monitoring process of resource data in the database, if the resource data is updated from the first data to the second data, it is considered that the resource data has changed. The updating from the first data to the second data may be that the original resource data has changed under the operation of the user, the resource data has been modified, and thus the resource data has been updated, resulting in the change of the resource data, or it may be the addition of resource data, such as the database does not contain the third data, but the third data is added, then the third data is considered to be the changed resource data, or if the fourth data in the database is deleted, then the fourth data is also considered to be the changed data.
[0080] As an optional example, the above conversion module includes:
[0081] A second determining unit, used to determine the table or field corresponding to the resource data;
[0082] The conversion unit is used to convert the data structure of resource data into a visual data structure according to the table or field to obtain metadata.
[0083] Optionally, in this embodiment, metadata is obtained by converting the changed resource data, so as to determine the table or field to which the changed resource data belongs, thereby generating metadata to describe which data has undergone what kind of changes. In other words, the type, storage location, and content of the changed resource data can be clearly identified through the metadata of the resource data, so that after the client obtains the resource data, it can adjust the resource data according to the metadata.
[0084] As an optional example, the storage module includes:
[0085] A third determining unit, used to determine a unique identifier of the metadata;
[0086] The storage unit is used to store the unique identifier of the metadata in the server.
[0087] Optionally, in this embodiment, after determining the changed resource data and converting the resource data to obtain metadata, a unique identifier of the metadata can be determined. The unique identifier can be a unique identity document (ID) for generating metadata, or a label for generating metadata. The unique identifier can distinguish different metadata, and metadata can be obtained based on the unique identifier.
[0088] In this embodiment, the unique identifier of the metadata may be stored in the server for the client to call. After the client calls the unique identifier of the metadata, the metadata may be obtained according to the unique identifier, thereby adjusting the local data according to the metadata.
[0089] As an optional example, the above device further includes:
[0090] A first determination module is used to determine the availability of a calling interface of the server when receiving an acquisition request for requesting metadata after the metadata is stored in the server, wherein the acquisition request is used to acquire the metadata through the calling interface;
[0091] The sending module is used to return the unique mark of the metadata in the server when the calling interface is available, so that the client can obtain the metadata according to the unique mark.
[0092] Optionally, in this embodiment, the client can obtain metadata or a unique identifier of metadata by calling a calling interface of the server. The calling interface can have different states, such as an available state and an unavailable state. If the calling interface is in an available state, the client can normally use the calling interface to obtain metadata or obtain a unique identifier of metadata, and then obtain metadata based on the unique identifier.
[0093] As an optional example, the above device further includes:
[0094] A first adjustment module is used to adjust the time interval of the client's scheduled polling calling interface from a first time interval to a second time interval when the calling interface is available, wherein the second time interval is greater than the first time interval;
[0095] The second adjustment module is used to adjust the time interval of the client's scheduled polling calling interface from the first time interval to a fixed time interval when the calling interface is unavailable, wherein the fixed time interval is the calling time interval when the client is not connected to the calling interface.
[0096] Optionally, in this embodiment, if the calling interface is available, when the client uses the calling interface to call metadata, the time interval of the client's scheduled polling calling interface can also be adjusted from the first time interval to the second time interval. The first time interval can be the time interval of the polling calling interface after the client accesses the calling interface and before using the calling interface to obtain metadata. When the client uses the calling interface to call metadata, the time interval is extended to the second time interval, and the second time interval is greater than the first time interval.
[0097] If the calling interface is unavailable, the time interval for the client to poll the calling interface can be adjusted from the first time interval to a fixed time interval. Since the calling interface is unavailable, the client can shorten the polling time interval, so as to use the calling interface to obtain metadata as soon as the calling interface is available.
[0098] As an optional example, the above device further includes:
[0099] The second determining module is used to determine that the calling interface is unavailable when an exception occurs in a listener that monitors the database or a converter that converts resource data.
[0100] For other examples of this embodiment, please refer to the above examples and will not be repeated here.
[0101] Optionally, whether the calling interface in this embodiment is available depends on whether there is an abnormal condition in the system. For example, whether the listener that monitors the changes in resource data in the database is abnormal, whether the converter that converts the changed resource data is abnormal, etc. If any node is abnormal, it is determined that the calling interface is unavailable. If all nodes are normal, it is determined that the calling interface is available. The above-mentioned nodes may also include nodes such as servers.
[0102] Figure 7 is a structural block diagram of an optional electronic device according to an embodiment of the present application, such as Figure 7 As shown, it includes a processor 702, a communication interface 704, a memory 706 and a communication bus 708, wherein the processor 702, the communication interface 704 and the memory 706 communicate with each other through the communication bus 708, wherein,
[0103] Memory 706, used to store computer programs;
[0104] The processor 702 is used to implement the following steps when executing the computer program stored in the memory 706:
[0105] Monitor resource data in the database;
[0106] When resource data changes, obtain the changed resource data;
[0107] Convert the changed resource data to obtain the metadata of the resource data;
[0108] The metadata is stored in the server so that the client can call the metadata.
[0109] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The communication interface is used for communication between the above electronic device and other devices.
[0110] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0111] As an example, the memory 706 may include, but is not limited to, the monitoring module 602, the acquisition module 604, the conversion module 606, and the storage module 608 in the request processing device. In addition, it may also include, but is not limited to, other module units in the request processing device, which will not be repeated in this example.
[0112] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0113] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0114] It can be understood by those skilled in the art that Figure 7 The structure shown is for illustration only. The device for implementing the above request processing method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 7 The structure of the electronic device is not limited. Figure 7 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 7 Different configurations shown.
[0115] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.
[0116] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the above-mentioned data calling method when executed by a processor.
[0117] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0118] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0119] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
[0120] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0121] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0122] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0123] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0124] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A data calling method, characterized in that: include: Monitor resource data in the database; When the resource data changes, acquiring the changed resource data; Converting the changed resource data to obtain metadata of the resource data; Storing the metadata in a server so that the client can call the metadata; After storing the metadata in the server, the method further includes: determining availability of a calling interface of the server upon receiving an acquisition request for the metadata, wherein the acquisition request is used to acquire the metadata through the calling interface; and returning a unique identifier of the metadata in the server when the calling interface is available, so that the client acquires the metadata according to the unique identifier; The method also includes: when the calling interface is available, adjusting the time interval for the client's periodic polling of the calling interface from a first time interval to a second time interval, wherein the second time interval is greater than the first time interval; when the calling interface is unavailable, adjusting the time interval for the client's periodic polling of the calling interface from the first time interval to a fixed time interval, wherein the fixed time interval is the calling time interval of the client when the calling interface is not connected.
2. The method according to claim 1, characterized in that When the resource data changes, acquiring the changed resource data includes: When the resource data in the database is updated from the first data to the second data, the second data is regarded as the changed resource data; or When third data is newly added to the database, the third data is regarded as the changed resource data; or When the fourth data in the database is deleted, the fourth data is regarded as the changed resource data.
3. The method according to claim 1, characterized in that The converting the changed resource data to obtain metadata of the resource data includes: Determine the table or field corresponding to the resource data; According to the table or the field, the data structure of the resource data is converted into a visual data structure to obtain the metadata.
4. The method according to claim 1, characterized in that: The storing the metadata in the server comprises: Determine a unique identifier for the metadata; The unique identifier of the metadata is stored in the server.
5. The method according to claim 1, characterized in that The method further comprises: In the case where an exception occurs in a listener that monitors the database or a converter that converts the resource data, it is determined that the calling interface is unavailable.
6. A data calling device, characterized in that: include: Monitoring module, used to monitor resource data in the database; An acquisition module, used for acquiring the changed resource data when the resource data changes; A conversion module, used for converting the changed resource data to obtain metadata of the resource data; A storage module, used for storing the metadata in a server so that the client can call the metadata; After storing the metadata in the server, the method further includes: upon receiving an acquisition request for the metadata, determining the availability of a calling interface of the server, wherein the acquisition request is used to acquire the metadata through the calling interface; and, if the calling interface is available, returning a unique identifier of the metadata in the server, so that the client acquires the metadata according to the unique identifier; The device also includes: when the calling interface is available, adjusting the time interval for the client's regular polling of the calling interface from a first time interval to a second time interval, wherein the second time interval is greater than the first time interval; when the calling interface is unavailable, adjusting the time interval for the client's regular polling of the calling interface from the first time interval to a fixed time interval, wherein the fixed time interval is the calling time interval of the client when the calling interface is not accessed.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is executed.
8. An electronic device, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 5 through the computer program.
Citation Information
Patent Citations
Method and device for just-in-time data updating
CN103714068A
Data synchronization method and device and terminal equipment
CN111984723A