CN114567677B - Data processing method and device and nonvolatile storage medium - Google Patents
Data processing method and device and nonvolatile storage medium Download PDFInfo
- Publication number
- CN114567677B CN114567677B CN202210441982.2A CN202210441982A CN114567677B CN 114567677 B CN114567677 B CN 114567677B CN 202210441982 A CN202210441982 A CN 202210441982A CN 114567677 B CN114567677 B CN 114567677B
- Authority
- CN
- China
- Prior art keywords
- node
- data
- version number
- cached
- memory medium
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/219—Managing data history or versioning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/24569—Query processing with adaptation to specific hardware, e.g. adapted for using GPUs or SSDs
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a data processing method and device and a nonvolatile storage medium. The method comprises the following steps: when terminal equipment connected with a first node in a communication system accesses data of a second node across nodes, acquiring the data and a version number of the second node, wherein the version number is the update time of the data of the second node; caching data and a version number of a second node in a first node through a memory medium according to a preset time length; asynchronously updating the data and the version number of the second node locally stored by the first node through the disk medium according to the data and the version number of the second node cached by the first node through the memory medium; determining data cached by the first node through a memory medium and data locally stored by the first node through a disk medium according to the version number; and when receiving an instruction from the target terminal equipment for acquiring the data cached by the first node, sending the data cached by the first node to the target terminal equipment.
Description
Technical Field
The present application relates to the field of data communication, and in particular, to a method and an apparatus for processing data, and a non-volatile storage medium.
Background
The interconnection function refers to cross-platform, cross-system, cross-organization flow and information sharing in a space network, and barrier-free communication among different organizations is formed. The personnel communication, resource sharing and business cooperation among two or more units can be realized. High-efficiency communication among different nodes in an interconnection environment is particularly important, and at present, data communication among different nodes in the interconnection environment generally adopts a direct connection request mode.
The request direct connection scheme is that any node records request addresses of all other nodes, and data access is completed by directly accessing the service of a target node through the specified node request address. The direct connection request scheme may cause that all other nodes are directly connected to one node, in which case, the master node is stressed unevenly and has poor concurrency.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides a data processing method and device and a nonvolatile storage medium, which are used for solving the technical problems that the pressure of a main node is unbalanced and the concurrency is poor due to the fact that data communication is realized by directly connecting different nodes in an interconnection environment at least in a request mode.
According to an aspect of an embodiment of the present application, there is provided a data processing method, including: when terminal equipment connected with a first node in a communication system accesses data of a second node across nodes, acquiring the data and a version number of the second node, wherein the version number is the update time of the data of the second node, and the first node and the second node are any two different nodes in the communication system; caching data and a version number of a second node in a first node through a memory medium according to a preset time length; asynchronously updating the data and the version number of the second node locally stored by the first node through a disk medium according to the data and the version number of the second node cached by the first node through a memory medium; determining data cached by the first node through a memory medium and data locally stored by the first node through a disk medium according to the version number; when an instruction for acquiring the data cached by the first node from the target terminal equipment is received, the data cached by the first node is sent to the target terminal equipment, wherein the target terminal equipment is any one of the terminal equipment.
Optionally, after caching the data and the version number of the second node in the first node according to a preset time length, the method further includes: and under the condition that the preset time length is not exceeded, if an instruction for accessing the data and the version number of the second node is received, querying the data and the version number of the second node from the cache data of the first node.
Optionally, the obtaining the data and the version number of the second node includes: the method comprises the steps that a first routing service corresponding to a first node is proxied to a second routing service corresponding to a second node, wherein the first node and the second node are respectively registered to the first routing service and the second routing service in advance, a routing address of the second routing service is stored in the first routing service, and a routing address of the first routing service is stored in the second routing service; and acquiring the data and the version number of the second node through the second routing service.
Optionally, determining, according to the version number, data cached by the first node through the memory medium and data locally stored by the first node through the disk medium includes: comparing the version number cached by the first node with the version number of the second node at the current moment under the condition that the preset time length is exceeded; and determining the data cached by the first node and the data locally stored by the first node according to the comparison result.
Optionally, determining the data cached by the first node and the data locally stored by the first node according to the comparison result includes: if the version number of the first node cache is different from the version number of the second node at the current moment, acquiring the data and the version number of the second node at the current moment; caching the data and the version number of the second node at the current moment in the first node according to the preset time length, and locally storing the data and the version number of the second node at the current moment in the first node.
Optionally, the method further includes: if the time interval between the current moment and the caching moment is larger than the preset time interval, acquiring the version number of the second node at the current moment, wherein the caching moment is the moment when the data and the version number of the second node are cached in the first node through the memory medium; and if the version number of the second node at the current moment is different from the version number of the first node cache, updating the version number of the first node cache through the memory medium and the version number of the first node locally stored through the disk medium by using the version number of the second node at the current moment.
Optionally, after asynchronously updating the data and the version number of the second node locally stored by the first node according to the data and the version number of the second node cached by the first node, the method further includes: if the second node fails at the current moment, judging whether the data cached by the first node at the target moment of the second node exists or not; if the current time is the current time, obtaining the data of the second node at the target time cached by the first node as the data of the second node at the current time, wherein the target time is the time before and closest to the current time; and if the data does not exist, acquiring the data of the second node at the target moment, which is locally stored by the first node, as the data of the second node at the current moment.
According to another aspect of the embodiments of the present application, there is also provided a data processing apparatus, including: the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is set to acquire data and a version number of a second node when a terminal device connected with a first node in a communication system accesses the data of the second node across nodes, the version number is the update time of the data of the second node, and the first node and the second node are any two different nodes in the communication system; the first storage module is set to cache the data and the version number of the second node in the first node through the memory medium according to preset time; the second storage module is set to asynchronously update the data and the version number of the second node locally stored by the first node through the disk medium according to the data and the version number of the second node cached by the first node through the memory medium; the determining module is configured to determine data cached by the first node through the memory medium and data locally stored by the first node through the disk medium according to the version number; the sending module is configured to send the data cached by the first node to the target terminal device when receiving an instruction from the target terminal device to obtain the data cached by the first node, wherein the target terminal device is any one of the terminal devices.
According to still another aspect of the embodiments of the present application, there is provided a nonvolatile storage medium, where the nonvolatile storage medium includes a stored program, and when the program runs, a device in which the nonvolatile storage medium is located is controlled to execute the above data processing method.
According to still another aspect of the embodiments of the present application, there is also provided a processor configured to execute a program stored in a memory, where the program executes the above data processing method.
In the embodiment of the application, when a terminal device connected with a first node in a communication system accesses data of a second node across nodes, the data and a version number of the second node are obtained, wherein the version number is the update time of the data of the second node, and the first node and the second node are any two different nodes in the communication system; caching data and a version number of a second node in a first node through a memory medium according to a preset time length; determining data cached by the first node according to the version number; asynchronously updating the data and the version number of the second node locally stored by the first node through the disk medium according to the data and the version number of the second node cached by the first node through the memory medium; determining data cached by the first node through a memory medium and data locally stored by the first node through a disk medium according to the version number; when an instruction for acquiring the data cached by the first node from the target terminal equipment is received, the data cached by the first node is sent to the target terminal equipment, wherein the target terminal equipment is in a mode of any one of the terminal equipment, when the data is updated by any node, the data updating time is used as a version number, when the data is inquired, the data and the version number of the target node are accessed in a direct connection request mode, and the data is cached in the inquiry node, so that the aim of improving the existing method for realizing the data communication among different nodes in the interconnection and interworking environment by adopting the direct connection request mode is fulfilled, the technical effects of improving the real-time performance of the data and improving the concurrency capability of the service are further fulfilled, further, the problem that the pressure of a main node is unbalanced when the data communication is realized among different nodes in the interconnection and interworking environment by adopting the direct connection request mode is solved, the concurrency is poor.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 shows a hardware configuration block diagram of a computer terminal (or mobile device) for implementing a data processing method;
FIG. 2 is a flow chart of a method of processing data according to an embodiment of the application;
FIG. 3 is a flow chart of gateway routing information synchronization according to an embodiment of the present application;
fig. 4 is a flowchart of a terminal device requesting data across nodes according to an embodiment of the present application;
fig. 5 is a block diagram of a data processing apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present application, there is provided an embodiment of a method for processing data, it is noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions, and that while a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different than here.
In the background art, data communication is generally performed between different nodes in the current interworking environment by means of direct connection request. The direct connection request scheme may cause that all other nodes are directly connected to one node, in which case, the master node is stressed unevenly and has poor concurrency.
In the prior art, different nodes in the interworking environment can also communicate data by adopting a data timing synchronization mode. The data timing synchronization scheme is that any node pushes data update to a central node, and the central node synchronizes data change to all child nodes at regular time to ensure the consistency of the data. The scheme can increase the complexity of the service, consume resources and have the defects of poor instantaneity and the like.
Aiming at the defects of the scheme, the method and the device mainly improve the existing scheme of requesting direct connection, and when any node updates data, the data updating time is used as a version number. When data is queried, target node data and the version number are accessed in a mode of directly connecting the request, the request data is cached at the query node, and the cached data is accessed within the caching period so as to achieve the effect of accelerating the query speed. When the cache fails, the locally stored data is updated by asynchronously comparing the version number of the target node, and when the target node fails, the locally stored data of the current node is degraded and accessed, so that the normal use of the service of the current node is ensured.
The method provided by the embodiment of the application can be executed in a mobile terminal, a computer terminal or a similar operation device. Fig. 1 shows a hardware configuration block diagram of a computer terminal (or mobile device) for implementing a data processing method. As shown in fig. 1, the computer terminal 10 (or mobile device 10) may include one or more (shown as 102a, 102b, … …, 102 n) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial BUS (USB) port (which may be included as one of the ports of the BUS), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors 102 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuit may be a single stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computer terminal 10 (or mobile device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the data processing method in the embodiment of the present application, and the processor 102 executes various functional applications and data processing, i.e., implements the data processing method described above, by executing the software programs and modules stored in the memory 104. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
Fig. 2 is a flowchart of a data processing method according to an embodiment of the present application, and as shown in fig. 2, the method includes the following steps:
step S202, when a terminal device connected with a first node in the communication system accesses data of a second node across nodes, acquiring the data and a version number of the second node, wherein the version number is the update time of the data of the second node, and the first node and the second node are any two different nodes in the communication system.
The above communication system is an interworking environment mentioned in the background art.
As an optional embodiment, when data of any node in the interworking environment is changed, the data update time of the node is recorded at the same time, and the data update time is used as a version number.
It should be noted that other meaningful numbers can be used for the version number, and the version number is not limited.
When terminal equipment connected with any node accesses target node data in a cross-node mode, data information and a version number of the target node are inquired in a direct connection request mode.
Step S204, caching the data and version number of the second node in the first node through the memory medium according to a preset duration.
In this step, the data and the version number of the target node (i.e., the second node) are cached in the access node (i.e., the first node) through the memory medium according to the preset duration.
Step S206, asynchronously updating the data and the version number of the second node locally stored by the first node through the disk medium according to the data and the version number of the second node cached by the first node through the memory medium; and determining the data cached by the first node through the memory medium and the data locally stored by the first node through the disk medium according to the version number.
In this step, the data cached by the first node is asynchronously updated by the first node through the data locally stored by the disk medium. The problem of losing cache failure data is avoided, and the safety of data storage can be improved.
Step S208, determining the data cached by the first node through the memory medium and the data locally stored by the first node through the disk medium according to the version number.
Step S210, when receiving an instruction from the target terminal device to obtain the data cached by the first node, sending the data cached by the first node to the target terminal device, where the target terminal device is any one of the terminal devices.
In this step, when the terminal device connected to the first node needs to acquire the data cached by the first node, the data cached by the first node is sent to the corresponding terminal device.
Through the steps, the target node data and the version number are accessed in a direct connection request mode, and the request data are cached in the query node, so that the aim of improving the existing method for realizing data communication between different nodes in an interconnection environment by adopting a direct connection request mode is fulfilled, and the technical effects of improving the real-time performance of data and improving the concurrency capability of services are achieved.
According to an optional embodiment of the present application, after the step S204 is executed to cache the data and the version number of the second node in the first node according to the preset duration, if an instruction to access the data and the version number of the second node is received under the condition that the preset duration is not exceeded, the data and the version number of the second node are queried from the cached data of the first node.
When the data of the target node is accessed in the effective period of the cache, the data of the target node cached by the current query node is directly accessed, and the technical effect of accelerating the data query speed can be realized by locally caching the data of the target node in the query node. After the main node result cache is added to the query node, the service concurrency capability can be remarkably improved.
In addition, compared with data timing synchronization, the method does not need to increase timing tasks, and can better ensure the reliability of the service. And the synchronization of the whole data is not needed, and only the basic data is synchronized and cached, so that the occupation of the disk space is reduced, and the real-time performance of the data is improved. The service performance can be improved without increasing the extra performance resource consumption.
As an alternative embodiment, the data of the target node may be cached locally at the query node by using a middleware class (redis, memcache, etc.), a local memory class (Map, List, etc. container implementation class).
According to another alternative embodiment of the present application, step S202 is executed to obtain the data and version number of the second node, and the following steps are performed: the method comprises the steps that a first routing service corresponding to a first node is proxied to a second routing service corresponding to a second node, wherein the first node and the second node are respectively registered to the first routing service and the second routing service in advance, a routing address of the second routing service is stored in the first routing service, and a routing address of the first routing service is stored in the second routing service; and acquiring the data and the version number of the second node through the second routing service.
In this step, by storing addresses of other nodes in the current query node, since all node services are registered to the node routing services and the registration information is shared among the node routing services, the first node proxies to the second routing service corresponding to the second node through the corresponding first routing service to acquire the second node data.
The purpose of adding the node routing service is that the address of the real child node service is not directly exposed, so that the child node does not need to remember the addresses of all other nodes, only needs to register to the routing service of the child node, and mutually remembers the routing addresses of the other nodes among the routing services. When accessing, the routing service from the target node is proxied through the routing service of the routing service proxy, and then the service from the target node is proxied.
In some optional embodiments of the present application, the executing step S208 of determining, according to the version number, data cached by the first node through the memory medium and data locally stored by the first node through the disk medium includes the following steps: comparing the version number cached by the first node with the version number of the second node at the current moment under the condition that the preset time length is exceeded; and determining the data cached by the first node and the data locally stored by the first node according to the comparison result.
As an optional embodiment, the data cached by the first node and the data locally stored by the first node are determined according to the comparison result, and the method is implemented by the following steps: if the version number of the first node cache is different from the version number of the second node at the current moment, acquiring the data and the version number of the second node at the current moment; caching the data and the version number of the second node at the current moment in the first node according to the preset time length, and locally storing the data and the version number of the second node at the current moment in the first node.
In the above, when the data of the target node is accessed in the effective period of the cache, the data of the target node cached by the current node is directly accessed. And if the version number of the target node cached locally by the query node exceeds the caching validity period, comparing the version number of the target node cached locally by the query node with the version number of the target node at the current moment, if the version number of the target node is inconsistent, querying data of the target node in a direct connection request mode, and synchronizing the queried data to the node cache and local storage.
Fig. 3 is a flowchart of gateway routing information synchronization according to an embodiment of the present application, and as shown in fig. 3, the gateway routing information synchronization process includes the following steps:
1) firstly, starting the services of all the sub-gateways;
2) starting the gateway A, and defaulting the version number to 0;
3) starting the gateway B, and jumping the gateway A every 30 seconds, wherein the default version number is 0;
4) starting a gateway C, and setting a default version number to be 0 every 30 seconds for a heartbeat gateway B (or a gateway A and a heartbeat gateway B in the following process);
5) sequentially starting node services;
6) starting a node server A, registering to a gateway A, and modifying the version number of the gateway A to be the current registration time;
7) if the version number of the gateway A is larger than that of the gateway B, after 30 seconds, the gateway B synchronizes the routing information and the version number of the gateway A, and similarly, the gateway C synchronizes the routing information and the version number of the gateway B;
8) the node service C registers to the gateway C, and the version number of the gateway C is modified to be the current registration time;
9) if the version number of the gateway C is larger than that of the gateway B, after 30 seconds, the gateway C pushes the routing information and the version number to the gateway B, and similarly, the gateway B pushes the routing information and the version number to the gateway A;
10) the node service B registers to the gateway B, and the version number of the gateway B is modified to be the current registration time;
11) if the version number of the gateway B is larger than that of the gateway A, after 30 seconds, the gateway B pushes the routing information and the version number to the gateway A, and the gateway C synchronizes the routing information and the version number of the gateway B similarly.
According to an optional embodiment of the present application, if a time interval between a current time and a caching time is greater than a preset time interval, acquiring a version number of a second node at the current time, where the caching time is a time when data and the version number of the second node are cached in a first node through a memory medium; and if the version number of the second node at the current moment is different from the version number of the first node cache, updating the version number of the first node cache through the memory medium and the version number of the first node locally stored through the disk medium by using the version number of the second node at the current moment.
As an optional embodiment, by setting a preset time interval, the version number cached by the first node through the memory medium and the version number locally stored by the first node through the disk medium are updated at regular time. For example, the time interval between the current time and the last time of caching the version number is longer than the preset time length, the version number of the second node is obtained, then the version number is compared with the latest cached version number of the first node, and if the version numbers are the same, no processing is performed; and if the two nodes are different, updating the version number cached by the first node and the version number stored locally by using the acquired version number of the second node.
In an alternative embodiment, the data and version numbers of the target node at different times may be cached at the querying node using threads and message queues. The data is stored in a queue mode, so that the integrity of the data of the current query node can be ensured.
According to another optional embodiment of the present application, after step S206 is executed to asynchronously update the data and version number of the second node locally stored by the first node according to the data and version number of the second node cached by the first node, if the second node fails at the current time, it is determined whether the data of the second node cached by the first node at the target time exists; if the current time is the current time, obtaining the data of the second node at the target time cached by the first node as the data of the second node at the current time, wherein the target time is the time before and closest to the current time; and if the data does not exist, acquiring the data of the second node at the target moment, which is locally stored by the first node, as the data of the second node at the current moment.
In an alternative embodiment, when the target node fails and cannot provide service, the data degradation process of the query node cache or the local storage is used to ensure that the use of the child node is not affected. For example, when the target node fails at time t1, because the query node stores the data of the target node at different times through the queue, and the different times correspond to different version numbers, the data at time t2 before time t1 can be obtained according to the version numbers for the query node to use, so as to ensure that the service of the query node is normally used.
In specific implementation, firstly, whether data at the time of t2 cached by the local node through the memory medium exists is queried, and if the data exist, the data at the time of t2 cached by the local node through the memory medium are acquired for the query node to use; if not, acquiring the data at the time t2 locally stored by the local node through the disk medium for the inquiry node to use
By adding version number comparison and local storage compensation mechanisms, the reliability of the service can be obviously increased.
The following describes a method with reference to a specific embodiment, and fig. 4 is a flowchart of a terminal device requesting data across nodes according to an embodiment of the present application, and as shown in fig. 4, the method includes the following steps:
1) a terminal A initiates an address book access request carrying a route C identifier;
2) requesting to enter a node service A, and inquiring address book data (cache time, version number and data) of a C enterprise in a cache of the node service A through a route C identifier;
3) if the cache exists, and the time interval between the current moment and the caching moment is less than the preset time (for example, 3 minutes), returning the cached address book data of the enterprise C;
4) if the cache fails or the time interval between the current moment and the cache moment is greater than the preset time length, the request route A forwards the access request;
5) the route A has no route C information, and local storage is inquired;
6) the route A has route C information, and the route C information is forwarded to the route C and then forwarded to the node service C;
7) the node service C checks whether the local version number is consistent with the version number of the request;
8) if the version numbers are consistent, modifying the caching time in the cached data of the node service A, and returning the address book data of the enterprise C cached in the node service A;
9) if the version numbers are not consistent, inquiring address book data of the enterprise C in the node service C;
10) updating address book data (caching time, version number and data) of the enterprise C cached in the node service A;
11) and meanwhile, the address book data and the version number of the enterprise C in the local storage of the node A are asynchronously updated.
Fig. 5 is a block diagram of a data processing apparatus according to an embodiment of the present application, and as shown in fig. 5, the apparatus includes:
the obtaining module 50 is configured to obtain data and a version number of a second node when a terminal device connected to a first node in a communication system accesses data of the second node across nodes, where the version number is an update time of the data of the second node, and the first node and the second node are any two different nodes in the communication system.
The first storage module 52 is configured to cache the data and the version number of the second node in the first node through the memory medium according to a preset duration.
A second storage module 54 configured to asynchronously update the data and the version number of the second node locally stored by the first node through the disk medium according to the data and the version number of the second node cached by the first node through the memory medium;
the determining module 56 is configured to determine, according to the version number, data cached by the first node through the memory medium and data locally stored by the first node through the disk medium.
The sending module 58 is configured to send the data cached by the first node to the target terminal device when receiving an instruction from the target terminal device to obtain the data cached by the first node, where the target terminal device is any one of the terminal devices.
It should be noted that, reference may be made to the description related to the embodiment shown in fig. 2 for a preferred implementation of the embodiment shown in fig. 5, and details are not described here again.
The embodiment of the application also provides a nonvolatile storage medium, wherein the nonvolatile storage medium comprises a stored program, and the device where the nonvolatile storage medium is located is controlled to execute the processing method of the data when the program runs.
The nonvolatile storage medium stores a program for executing the following functions: when terminal equipment connected with a first node in a communication system accesses data of a second node across nodes, acquiring the data and a version number of the second node, wherein the version number is the update time of the data of the second node, and the first node and the second node are any two different nodes in the communication system; caching data and a version number of a second node in a first node through a memory medium according to a preset time length; asynchronously updating the data and the version number of the second node locally stored by the first node through the disk medium according to the data and the version number of the second node cached by the first node through the memory medium; determining data cached by the first node through a memory medium and data locally stored by the first node through a disk medium according to the version number; when an instruction for acquiring the data cached by the first node from the target terminal equipment is received, the data cached by the first node is sent to the target terminal equipment, wherein the target terminal equipment is any one of the terminal equipment.
The embodiment of the present application further provides a processor, where the processor is configured to run a program stored in a memory, and when the program runs, the processor executes the above data processing method.
The processor is used for running a program for executing the following functions: when terminal equipment connected with a first node in a communication system accesses data of a second node across nodes, acquiring the data and a version number of the second node, wherein the version number is the update time of the data of the second node, and the first node and the second node are any two different nodes in the communication system; caching data and a version number of a second node in a first node through a memory medium according to a preset time length; asynchronously updating the data and the version number of the second node locally stored by the first node through the disk medium according to the data and the version number of the second node cached by the first node through the memory medium; determining data cached by the first node through a memory medium and data locally stored by the first node through a disk medium according to the version number; when an instruction for acquiring the data cached by the first node from the target terminal equipment is received, the data cached by the first node is sent to the target terminal equipment, wherein the target terminal equipment is any one of the terminal equipment.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.
Claims (10)
1. A method of processing data, comprising:
when terminal equipment connected with a first node in a communication system accesses data of a second node across nodes, acquiring the data and a version number of the second node, wherein the version number is the update time of the data of the second node, and the first node and the second node are any two different nodes in the communication system;
caching the data and the version number of the second node in the first node through a memory medium according to a preset time length;
asynchronously updating the data and the version number of the second node locally stored by the first node through a disk medium according to the data and the version number of the second node cached by the first node through a memory medium;
determining data cached by the first node through a memory medium and data locally stored by the first node through a disk medium according to the version number;
when an instruction for acquiring the data cached by the first node from a target terminal device is received, the data cached by the first node is sent to the target terminal device, wherein the target terminal device is any one of the terminal devices.
2. The method of claim 1, wherein after caching the data and version number of the second node at the first node for a preset duration, the method further comprises:
and under the condition that the preset time length is not exceeded, if an instruction for accessing the data and the version number of the second node is received, querying the data and the version number of the second node from the cache data of the first node.
3. The method of claim 1, wherein obtaining the data and version number of the second node comprises:
proxying a first routing service corresponding to the first node to a second routing service corresponding to the second node, wherein the first node and the second node are respectively registered to the first routing service and the second routing service in advance, a routing address of the second routing service is stored in the first routing service, and a routing address of the first routing service is stored in the second routing service;
and acquiring the data and the version number of the second node through the second routing service.
4. The method of claim 1, wherein determining the data cached by the first node through the memory medium and the data stored locally by the first node through the disk medium according to the version number comprises:
comparing the version number cached by the first node with the version number of the second node at the current moment under the condition that the preset time length is exceeded;
and determining the data cached by the first node and the data locally stored by the first node according to the comparison result.
5. The method of claim 4, wherein determining the data cached by the first node and the data stored locally by the first node according to the comparison comprises:
if the version number cached by the first node is different from the version number of the second node at the current moment, acquiring the data and the version number of the second node at the current moment;
and caching the data and the version number of the second node at the current moment in the first node according to the preset duration and locally storing the data and the version number of the second node at the current moment in the first node.
6. The method of claim 1, further comprising:
if the time interval between the current moment and the caching moment is larger than a preset time interval, acquiring the version number of the second node at the current moment, wherein the caching moment is the moment when the data and the version number of the second node are cached in the first node through a memory medium;
and if the version number of the second node at the current moment is different from the version number of the first node cache, updating the version number of the first node through the memory medium cache and the version number of the first node through the disk medium local storage by using the version number of the second node at the current moment.
7. The method of claim 1, wherein after asynchronously updating the second node's data and version number stored locally by the first node based on the second node's data and version number cached by the first node, the method further comprises:
if the second node fails at the current moment, judging whether the data cached by the first node at the target moment of the second node exists or not;
if the current time is the current time, obtaining the data of the second node at the target time cached by the first node as the data of the second node at the current time, wherein the target time is the time before and closest to the current time;
and if the current data does not exist, acquiring the data of the second node at the target moment, which is locally stored by the first node, as the data of the second node at the current moment.
8. An apparatus for processing data, comprising:
an obtaining module, configured to obtain data and a version number of a second node when a terminal device connected to a first node in a communication system accesses data of the second node across nodes, where the version number is an update time of the data of the second node, and the first node and the second node are any two different nodes in the communication system;
the first storage module is set to cache the data and the version number of the second node in the first node through a memory medium according to preset time;
the second storage module is configured to asynchronously update the data and the version number of the second node locally stored by the first node through a disk medium according to the data and the version number of the second node cached by the first node through a memory medium;
the determining module is configured to determine, according to the version number, data cached by the first node through a memory medium and data locally stored by the first node through a disk medium;
the sending module is configured to send the data cached by the first node to a target terminal device when receiving an instruction from the target terminal device to obtain the data cached by the first node, wherein the target terminal device is any one of the terminal devices.
9. A non-volatile storage medium, comprising a stored program, wherein when the program runs, a device in which the non-volatile storage medium is located is controlled to execute the data processing method according to any one of claims 1 to 7.
10. A computer device comprising a processor and a memory, the memory storing a computer program executable by the processor; the processor is configured to execute the computer program to implement the method of processing data of any one of claims 1 to 7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210441982.2A CN114567677B (en) | 2022-04-26 | 2022-04-26 | Data processing method and device and nonvolatile storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210441982.2A CN114567677B (en) | 2022-04-26 | 2022-04-26 | Data processing method and device and nonvolatile storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114567677A CN114567677A (en) | 2022-05-31 |
| CN114567677B true CN114567677B (en) | 2022-07-29 |
Family
ID=81721571
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210441982.2A Active CN114567677B (en) | 2022-04-26 | 2022-04-26 | Data processing method and device and nonvolatile storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114567677B (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115048600B (en) * | 2022-06-29 | 2025-12-12 | 中控技术股份有限公司 | Page data loading methods, devices, electronic devices, and non-volatile storage media |
| CN115665245A (en) * | 2022-10-25 | 2023-01-31 | 中国农业银行股份有限公司 | A local cache refresh method, device, electronic equipment and storage medium |
| CN116633616A (en) * | 2023-05-22 | 2023-08-22 | 阿里云计算有限公司 | Data access method, system, equipment and storage medium |
| CN119759401B (en) * | 2024-12-05 | 2025-11-04 | 天翼云科技有限公司 | A component processing method, apparatus, electronic device, and storage medium based on a cloud environment. |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102098344A (en) * | 2011-02-21 | 2011-06-15 | 中国科学院计算技术研究所 | Method and device for synchronizing editions during cache management and cache management system |
| CN113220669A (en) * | 2021-06-09 | 2021-08-06 | 京东科技控股股份有限公司 | Service data processing method and device and electronic equipment |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8407689B2 (en) * | 2010-06-25 | 2013-03-26 | Microsoft Corporation | Updating nodes considering service model constraints |
| US10970354B2 (en) * | 2017-07-17 | 2021-04-06 | Songtradr, Inc. | Method for processing code and increasing website and client interaction speed |
| US11042479B2 (en) * | 2019-01-08 | 2021-06-22 | Oracle International Corporation | Fully active and non replicated block storage solution |
| CN113407639B (en) * | 2021-07-16 | 2024-05-14 | 广州市百果园信息技术有限公司 | Data processing method, device, system and storage medium |
-
2022
- 2022-04-26 CN CN202210441982.2A patent/CN114567677B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102098344A (en) * | 2011-02-21 | 2011-06-15 | 中国科学院计算技术研究所 | Method and device for synchronizing editions during cache management and cache management system |
| CN113220669A (en) * | 2021-06-09 | 2021-08-06 | 京东科技控股股份有限公司 | Service data processing method and device and electronic equipment |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114567677A (en) | 2022-05-31 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN114567677B (en) | Data processing method and device and nonvolatile storage medium | |
| KR102513998B1 (en) | Communication methods and devices, entities and computer readable storage media | |
| CN110377431B (en) | Service calling method and device under multi-registry scene | |
| CN109428749B (en) | Network management method and related equipment | |
| CN107317830B (en) | Method and device for processing service discovery | |
| CN111049854A (en) | Method and device for transmitting service request | |
| KR101389101B1 (en) | Method and apparatus for tracking device management data changes | |
| CN112995247B (en) | Method, device and system for transmitting or processing data | |
| CN110825772A (en) | Method and device for synchronizing memory data of multiple service instances and storage medium | |
| CN109586969A (en) | Content distributing network disaster recovery method, device, computer equipment and storage medium | |
| US11032362B2 (en) | System operating using OPC UA, communication method using OPC UA, and load balancer | |
| US20240340338A1 (en) | Methods of Operating Service Control Nodes | |
| US20210329098A1 (en) | Methods of operating service instance sets and/or set restoration storage resources and related network nodes | |
| CN115562757A (en) | Data processing method, configuration center system, electronic device, and storage medium | |
| CN110704158A (en) | Method, apparatus and storage medium for forwarding access requests within a container cluster | |
| US20220014887A1 (en) | Methods providing service context transfer and related network nodes | |
| CN111367685B (en) | Interface calling method and device, computer equipment and storage medium | |
| CN113079098A (en) | Method, device, equipment and computer readable medium for updating route | |
| CN113703866B (en) | Configuration center information synchronization method and system | |
| CN110858201A (en) | Data processing method and system, processor and storage medium | |
| CN115004657B (en) | Addressing method, addressing system and addressing device | |
| CN113094074B (en) | Service cluster updating method and device | |
| CN116302618B (en) | Session information processing method and device | |
| CN112416321A (en) | Application generation method and device, storage medium and electronic device | |
| CN119182819A (en) | Communication method, device, terminal and storage medium based on micro front end architecture |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |