Cross-service data sharing method and system

By enabling stateless service data sharing under a cloud-native architecture through a configuration center, the traditional solution cannot adapt to the dependency problem of cloud-native architecture, and achieves data sharing and behavioral consistency between services.

CN115145649BActive Publication Date: 2025-10-28BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110347606.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-31
Publication Date
2025-10-28
Estimated Expiration
2041-03-31

AI Technical Summary

Technical Problem

In a cloud-native architecture, traditional data sharing solutions cannot meet the data sharing needs between stateless services, resulting in high service dependencies and affecting the elastic scaling of the system.

Method used

A configuration center is introduced as a unified data caching medium. Data sharing is achieved through the interaction between services and the configuration center, avoiding direct dependencies between services. Data is transferred using listening and writing operations.

Benefits of technology

It enables data sharing between stateless services, ensuring consistency in task awareness and behavior among services, and adapting to the highly elastic scaling requirements of cloud-native architectures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115145649B_ABST
    Figure CN115145649B_ABST
Patent Text Reader

Abstract

This application discloses a cross-service data sharing method and system. This method and system add a unified configuration center to multiple services within a decentralized service system. Data sharing between different services is achieved by performing write, listen, and read operations on the configuration center from various services. This ensures consistent information perception and behavioral matching between different services. Since this application utilizes the configuration center as a data cache and transmission medium, data transmission between different services does not require interfaces and protocols, effectively avoiding service dependencies on any other service and preventing services from providing data to other services. Therefore, this application provides a cross-service data sharing solution that is better suited for cloud-native architecture scenarios and for stateless multi-service operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of data sharing technology, and in particular relates to a cross-service data sharing method and system. Background Technology

[0002] Currently, when data needs to be shared between multiple services, data is generally transferred through interfaces between services. For example, if service 1 needs to share data with service 2, service 1 can transfer data to service 2 by calling the data interface of service 2.

[0003] The above solutions are applicable to traditional B / S (Browser / Server) or C / S (Client / Server) architectures. However, in cloud-native architectures, most services are deployed in the cloud. To cope with the huge fluctuations in cloud traffic, cloud service systems are typically required to have high elastic scaling capabilities. This requires that each service in the service system ideally operate statelessly, meaning that the operation of a service does not depend on any other service, and the shutdown or addition of a service will not affect other services. Since this stateless operating mode requires that the service itself does not provide data to external services or depend on any other service, traditional data sharing solutions are not well-suited for cloud-native architecture scenarios. Summary of the Invention

[0004] In view of this, this application provides a cross-service data sharing method and system to realize data sharing among multiple stateless services, so as to achieve the purpose of consistent task awareness and behavior matching among multiple stateless services.

[0005] The specific technical solution is as follows:

[0006] A cross-service data sharing method is provided, the method being applied to a cross-service data sharing system, the cross-service data sharing system comprising: a configuration center and a service system; the service system comprising a first service and at least one second service; the method comprising:

[0007] The first service writes the data information to be shared into the configuration center;

[0008] The at least one second service monitors data changes in the configuration center;

[0009] If the at least one second service detects that the data information is written to the configuration center, the at least one second service obtains at least a portion of the data information and performs corresponding response processing based on the obtained at least a portion of the data.

[0010] Optionally, the first service writes the data information to be shared into the configuration center, including:

[0011] The first service writes the data information to be shared into a predetermined path in the configuration center;

[0012] The at least one second service monitors data changes in the configuration center, including: the at least one second service monitors data changes under the predetermined path in the configuration center.

[0013] Optionally, the above methods also include:

[0014] When there is a need to expand service capacity, create a new service based on the image file of the target service.

[0015] The newly established service establishes a communication connection with the configuration center to write data information to the configuration center or share data from the configuration center based on listening to the configuration center;

[0016] The target service is the first service and / or the second service.

[0017] Optionally, the service system is a cloud storage service system deployed in the cloud to provide cloud data storage and query services;

[0018] The at least one second service includes at least one storage service and at least one query service.

[0019] Optionally, the cross-service data sharing system may also include a storage center;

[0020] The data information includes: user identifier, description information of the first target data to be stored by the user, and the target storage path indicated for the first target data in the storage center;

[0021] The at least one second service acquires at least a portion of the data information and performs corresponding response processing based on the acquired at least a portion of the data, including:

[0022] The at least one storage service obtains the data information and establishes a data transmission channel with the user based on the user identifier in the data information;

[0023] The at least one query service obtains the user identifier from the data information and performs recording processing to obtain the recording result.

[0024] Optionally, the at least one query service may at least obtain the user identifier from the data information and perform recording processing, including:

[0025] The at least one query service obtains the user identifier from the data information and performs recording processing;

[0026] Alternatively, the at least one query service may retrieve all data from the data information and perform recording processing.

[0027] Optionally, if there are multiple storage services, after the at least one storage service establishes a data transmission channel with the user, the method further includes:

[0028] The target storage service among multiple storage services receives a write request from the user instructing the writing of the first target data; and writes the first target data to the corresponding location in the storage center according to the target storage path and the description information;

[0029] The target storage service is a service selected from the plurality of storage services based on a first strategy.

[0030] Optionally, if there are multiple query services, after at least one query service obtains the user identifier from the data information and performs recording processing to obtain the recording result, the process further includes:

[0031] The target query service among the multiple query services receives a user's read request indicating the need to read second target data; and based on the recorded results, queries the second target data from the storage center and provides feedback to the user;

[0032] The target query service is a service selected from the plurality of query services based on a second strategy.

[0033] A cross-service data sharing system includes: a configuration center and a service system; the service system includes a first service and at least one second service, wherein:

[0034] The first service is used to write the data information to be shared into the configuration center;

[0035] The at least one second service is used for:

[0036] Monitor data changes in the configuration center;

[0037] If the data information is detected being written to the configuration center, at least a portion of the data information is obtained, and corresponding response processing is performed based on the obtained at least a portion of the data.

[0038] Optionally, the first service is specifically used for:

[0039] Write the data to be shared to the predetermined path in the configuration center;

[0040] When the second service is monitoring data changes in the configuration center, it is specifically used to monitor data changes under the predetermined path in the configuration center.

[0041] Optionally, the service system may further include:

[0042] The third service is used to create a new service based on the image file of the target service when there is a need to expand the service.

[0043] The target service is the first service and / or the second service; the newly created service establishes a communication connection with the configuration center to write data information to the configuration center or share data from the configuration center based on listening to the configuration center.

[0044] Optionally, the service system is a cloud storage service system deployed in the cloud to provide cloud data storage and query services;

[0045] The at least one second service includes at least one storage service and at least one query service.

[0046] Optionally, the above system may also include: a storage center for data storage;

[0047] The data information includes: user identifier, description information of the first target data to be stored by the user, and the target storage path indicated for the first target data in the storage center;

[0048] The at least one storage service is used to obtain the data information when it is detected that the data information is written to the configuration center, and to establish a data transmission channel with the user based on the user identifier in the data information;

[0049] The at least one query service is used to, when it detects that the data information is being written to the configuration center, at least obtain the user identifier in the data information and perform recording processing to obtain the recording result.

[0050] Optionally, when the at least one query service obtains the user identifier from the data information and performs record processing, it is specifically used for:

[0051] Obtain the user identifier from the data information and record it;

[0052] Alternatively, all data in the data information can be obtained and recorded.

[0053] Optionally, if there are multiple storage services, the target storage service among the multiple storage services is further used for:

[0054] Receive a write request from a user instructing the writing of the first target data; and write the first target data to the corresponding location in the storage center according to the target storage path and the description information;

[0055] The target storage service is a service selected from the plurality of storage services based on a first strategy.

[0056] Optionally, if there are multiple query services, the target query service among the multiple query services is further used for:

[0057] Receive a user's read request indicating the need to read second target data; and based on the recorded results, query the second target data from the storage center and provide feedback to the user;

[0058] The target query service is a service selected from the plurality of query services based on a second strategy.

[0059] As can be seen from the above scheme, the cross-service data sharing method and system provided in this application embodiment adds a unified configuration center to the multiple services included in the decentralized service system, and realizes data sharing between different services by performing data writing, listening, and reading operations on the configuration center in each service. This achieves the goal of consistent information perception and behavioral matching between different services. Since this application uses the configuration center as a data cache and transmission medium, different services do not need to transmit data based on interfaces and protocols, effectively avoiding the dependence of services on any other services, and the provision of data by services to other services (for each service, it is only responsible for interacting with the configuration center and does not care about the data supply and demand relationship with any other service). Therefore, this application realizes a cross-service data sharing scheme that is better applicable to cloud-native architecture scenarios and in the case of stateless operation of multiple services. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0061] Figure 1 This is a flowchart illustrating a cross-service data sharing method provided in an embodiment of this application;

[0062] Figure 2 This is a schematic diagram illustrating data sharing among multiple services through a configuration center, as provided in an embodiment of this application.

[0063] Figure 3 This is a schematic diagram illustrating how different services in the cloud storage service system provided in this application share data through a configuration center;

[0064] Figure 4 This is a flowchart illustrating an implementation of a cross-service data sharing method in a cloud storage scenario provided in this application embodiment;

[0065] Figure 5 This is another implementation flowchart of the cross-service data sharing method in the cloud storage scenario provided in the embodiments of this application;

[0066] Figure 6 This is a diagram of a cloud-based load-balanced storage architecture provided in an embodiment of this application;

[0067] Figure 7 This is another flowchart illustrating the cross-service data sharing method provided in this application embodiment;

[0068] Figure 8 This is a schematic diagram illustrating data sharing among multiple services through a configuration center after service expansion provided in this application embodiment;

[0069] Figure 9 This is a structural diagram of the cross-service data sharing system provided in the embodiments of this application. Detailed Implementation

[0070] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0071] To achieve data sharing among multiple stateless services and ensure consistent task awareness and behavior matching among them, this application discloses a cross-service data sharing method and system. Typically, this method and system are applicable to data sharing among multiple services in a cloud-native architecture.

[0072] See Figure 1 This illustration shows a flowchart of a cross-service data sharing method provided in an embodiment of this application. The method can be applied to a data sharing system including a configuration center and a service system, wherein the service system is a decentralized service system including multiple services, specifically including a first service and at least one second service.

[0073] like Figure 1As shown, the cross-service data sharing method in this embodiment includes the following processing steps:

[0074] Step 101: The first service in the service system writes the data information to be shared into the configuration center.

[0075] The first service mentioned above is a service included in the service system for sharing data with other services in the service system, which triggers other services to perform corresponding response processing by sharing data with other services.

[0076] For example, in a cloud storage service system (deployed in the cloud to provide users with cloud data storage and query services), the first service could specifically be a central control service provided by the central console of the service system. This central control service is responsible for detecting user storage access requests. When it detects a user's storage access request, it shares the relevant data information of the request with other services in the system to trigger them to respond and perform corresponding actions, such as establishing a data transmission channel with the user to receive the user's data to be stored, or recording information to update the matching rules when querying data. Alternatively, the first service could also be a system resource allocation service in the service system responsible for allocating system resources to other services. By sharing the allocated system resources with other services in the system, it triggers those services to configure their own resources.

[0077] In order to achieve data sharing among multiple stateless services, this application sets up a centralized configuration center for the decentralized services. The main function of the configuration center is to serve as a data caching medium for shared data between different services in the service system.

[0078] During implementation, a storage location corresponding to a predetermined path in the configuration center can be selected for data caching of different services in the service system and data sharing between different services.

[0079] See Figure 2 As shown, each service in the service system (the first service, the second service) directly interfaces and interacts with the configuration center. Each service can achieve data sharing and task awareness by writing, modifying, or listening to and reading data under this path in the configuration center according to actual needs.

[0080] Based on this, in step 101, the first service in the service system writes the data information to be shared into the configuration center. Specifically, the first service writes the data information to be shared into the storage location corresponding to the predetermined path in the configuration center.

[0081] The data information written by the first service to the predetermined path in the configuration center depends on the actual application scenario.

[0082] For example, in the scenario of system resource allocation for services, the data information written by the first service (which can be the system resource allocation service in the service system) to the predetermined path of the configuration center may include, but is not limited to, the memory resources, IO (Input / Output) resources, and other resource information allocated to other services in the service system.

[0083] Step 102: The above-mentioned at least one second service in the service system listens for data changes in the configuration center.

[0084] In contrast to the first service, the second service is a service within the service system that needs to perform corresponding response processing by sharing data information from the first service. For example, the second service could be a storage service in a cloud storage service system, used to sense and share data information related to a user's storage access request provided by the system's central control service, thereby triggering the establishment of a data transmission channel with the user. Alternatively, the second service could also be a query service within the system, used to share data information related to a user's storage access request provided by the system's central control service, thereby triggering corresponding information recording processing to update the matching rules during data queries.

[0085] In order to enable information awareness and data sharing among services in a stateless operating environment, each secondary service in the service system (such as storage service and query service) monitors the changes in data under the aforementioned predetermined path in the configuration center in real time.

[0086] Specifically, in implementation, each second service can subscribe to and listen to a predetermined path in the configuration center when it starts up, and establish a listening relationship with it. After the listening relationship is established, if data is added or modified in that path in the configuration center due to the first service writing data information, each second service can be aware of this information change in the data in that path based on the listening relationship.

[0087] Step 103: If at least one of the second services detects that the above data information is written to the configuration center, the at least one second service obtains at least a portion of the data information and performs corresponding response processing based on the obtained at least a portion of the data.

[0088] When each of the second services detects data changes under the aforementioned predetermined path in the configuration center through monitoring, i.e., when it detects data information being written to that path, each second service reads at least a portion of that data information from that path in the configuration center. This achieves data awareness and data sharing between the first service and the second services through the configuration center. Based on this, each second service further performs corresponding actions based on the read at least a portion of the data to achieve the required response processing, thereby achieving consistency in task awareness and behavioral actions between the second and first services. For example, each second service can perform its own resource configuration by reading system resource configuration information written by the first service from the configuration center.

[0089] As can be seen from the above scheme, the cross-service data sharing method provided in this application embodiment adds a unified configuration center to the multiple services included in the decentralized service system, and realizes data sharing between different services by performing data writing, listening, and reading operations on the configuration center in each service. This achieves the goal of consistent information perception and behavioral matching between different services. Since this application uses the configuration center as a data cache and transmission medium, different services do not need to transmit data based on interfaces and protocols, effectively avoiding the dependence of services on any other services, and the provision of data by services to other services (for each service, it is only responsible for interacting with the configuration center and does not care about the data supply and demand relationship with any other service). Therefore, this application realizes a cross-service data sharing scheme that is better applicable to cloud-native architecture scenarios and in the case of stateless operation of multiple services.

[0090] A typical application scenario for this application is cloud storage of user data. In this scenario, the aforementioned service system can specifically be a cloud storage service system used to provide users with cloud data storage and query services, see [link to relevant documentation]. Figure 3 The system architecture diagram shown includes a central control service, at least one storage service, and at least one query service. For details, please refer to the descriptions of the central control service, storage service, and query service above.

[0091] The following section will provide a detailed implementation process of the method described in this application for this scenario, such as... Figure 4 As shown, in this scenario, the cross-service data sharing method of this application can be specifically implemented as follows:

[0092] Step 401: Upon receiving a user's storage access request, the central control service in the cloud storage service system writes the corresponding data information to the configuration center based on the storage access request.

[0093] Users of cloud storage service systems can be non-individual users such as enterprises and organizations, or they can be individual users; there are no restrictions.

[0094] When a user of a cloud storage service system has data storage needs, such as the need to store new data in the cloud storage service system or the need to modify data already stored in the cloud, they will send a storage access request to the cloud storage service system. This request may carry, but is not limited to, user identifiers and descriptive information of the first target data to be stored by the user. The user identifier is the user ID (IdentityDocument) that the individual or enterprise / organization user has registered in advance in the system. The descriptive information of the first target data to be stored by the user includes, but is not limited to, the file name and / or folder name corresponding to the first target data.

[0095] The central control service in the cloud storage service system is responsible for detecting the storage access request. When the request is detected, it writes the relevant data information of the request to the configuration center. With the help of the data caching and data sharing functions of the configuration center, other services in the system (such as storage services and query services) are triggered to detect the task and execute the corresponding actions, so as to provide users with data writing storage services.

[0096] When the central control service writes relevant data information to the configuration center based on the detected storage access request, the data information written includes, but is not limited to: user identifier, description information of the first target data to be stored by the user, and the target storage path in the storage center indicated for the first target data.

[0097] In implementation, the configuration center can, but is not limited to, using key-value pairs to store data. For cloud storage scenarios of user data, this key-value pair can be specifically set as: key-{userId, project, topic}, where:

[0098] “key” represents the primary key of the data information, which can be set to a data number / serial number generated sequentially, but is not limited to.

[0099] “userId” represents the user identifier;

[0100] "Project" refers to a logical hierarchical location in the hierarchical storage architecture of cloud files. It can be understood as a storage path allocated by the central control service for the user's first target data to be stored (such as image data in the album).

[0101] "topic" represents the description information of the first target data to be stored by the user, such as the file name and / or folder name corresponding to the first target data.

[0102] The central control service can write new user data to the configuration center by adding a new key-value pair, and can also write modified user data to the configuration center by writing values ​​to existing key-value pairs.

[0103] Step 402: Each storage service and each query service in the cloud storage service system monitors data changes in the configuration center.

[0104] The various storage services and query services in the cloud storage service system monitor data changes under the predetermined path in the configuration center in real time to achieve information awareness.

[0105] For example, the central control service might write new data to the configuration center: K2-{userId:user2, project: logical layer position 2, topic:"yyy"}, or, if a key-value pair such as K1-{userId:user1, project: logical layer position 1, topic:"xxx"} already exists in the configuration center, it might write K1-{userId:user1, project: logical layer position 1, topic:"zzz"} to the configuration center to modify the data. All of these actions can be detected by various storage services and query services based on their monitoring capabilities.

[0106] Step 403: When each storage service in the cloud storage service system detects the above data information being written to the configuration center, each storage service obtains the data information and establishes a data transmission channel with the user based on the user identifier in the data information.

[0107] Specifically, when each storage service in the cloud storage service system detects the aforementioned data being written to the configuration center, it executes a corresponding response process, which includes:

[0108] Read the data information written by the configuration center, such as the values ​​of userId, project, and topic, and establish a data transmission channel between the userId and the corresponding user who initiated the storage access request. For example, open an information queue for the user indicated by the userId to receive the user's first target data and thus realize data storage.

[0109] Step 404: When each query service in the cloud storage service system detects the above data information being written to the configuration center, each query service shall at least obtain the user identifier in the data information and record it to obtain the recording result.

[0110] The various query services in the cloud storage service system are used to provide users with cloud data query functions. They need to know at least which users can query and can use the corresponding matching rules to perform rule matching when querying. Therefore, when the various query services in the cloud storage service system hear the above data information being written to the configuration center, each query service should at least read the user identifier (userId, such as user1, which may or may not exist in the history) in the data information and record it.

[0111] In one implementation, only the user identifier in the data information can be read and recorded.

[0112] Optionally, in another embodiment, all data in the data information can be read and recorded. That is, in addition to reading the user identifier, other information such as items and topics in the data information can also be read and recorded. The recording process in this embodiment can be: based on the read data information, constructing and storing matching rules for data querying. For example, the matching rules can include the correspondence between each topic (representing the corresponding user data) and its associated item (storage path) and user ID.

[0113] This embodiment adds a configuration center to a decentralized cloud storage service system, and uses the configuration center to facilitate data sharing between different services within the system. This enables data sharing, task awareness, and consistent action behavior matching among different services even when they are running statelessly. Furthermore, the shutdown or addition of one service will not affect other services. For example, the central control service only needs to write the data to be shared to a predetermined path in the configuration center each time, without needing to worry about whether individual storage or query services are abnormal, have been added, or have stopped running. The central control service will not experience data sharing failures or need to be re-shared due to the abnormality or shutdown of a particular storage or query service.

[0114] In the aforementioned cloud storage service system, under certain circumstances, it may include at least one storage service, specifically multiple storage services with identical processing logic, and / or it may include at least one query service, specifically multiple query services with identical processing logic. This is common in cloud-native architectures and is intended to handle high-traffic request access (write requests, read requests / query requests) in the cloud.

[0115] For this situation, see Figure 5 The flowchart of the cross-service data sharing method shown in this application may further include the following after step 403:

[0116] Step 405: The target storage service in the multiple storage services receives the user's write request to indicate the writing of the first target data; and writes the first target data to the corresponding location in the storage center according to the target storage path and description information in the monitored and acquired data information.

[0117] The aforementioned target storage service is a service selected from multiple storage services in the cloud storage service system based on the first strategy.

[0118] The first strategy can be, but is not limited to, a load balancing strategy based on the system resources (memory, IO) or load capacity of each storage service in the cloud storage service system.

[0119] Specifically, such as Figure 6 As shown, in a cloud storage service system that includes multiple storage services, each storage service runs a load balancing service on top of it. This service is responsible for receiving write requests from users for data to be stored. Upon receiving the write request, the service selects a target storage service from the multiple storage services in the system to handle the write request based on the load balancing strategy, and then forwards the write request to the selected target storage service.

[0120] After receiving the forwarded write request, the target storage service receives the user's first target data to be stored based on the data transmission channel (e.g., information queue) established by listening to the path in the configuration center. Then, according to the relevant data information of the first target data shared from the configuration center (e.g., the logical hierarchical position of the target data in the cloud file hierarchical storage architecture represented by "project", and the file / folder name corresponding to the first target data represented by "topic"), the received first target data is written to the corresponding location in the storage center to realize the storage service for user data.

[0121] Similarly, see further. Figure 5 The cross-service data sharing method disclosed in this application, after step 404, may further include:

[0122] Step 406: The target query service among the multiple query services receives the user's read request indicating the reading of the second target data; and according to the record results, queries the second target data from the storage center and provides feedback to the user;

[0123] The target query service is a service selected from multiple storage services of the cloud storage service system based on the second strategy.

[0124] The second strategy could be a load balancing strategy based on the system resources (memory, IO) or load capacity of each query service in the cloud storage service system.

[0125] In a cloud storage service system that includes multiple query services, each query service also runs a load balancing service on top of it. This service is responsible for receiving users' read requests (query requests) for the stored second target data. Upon receiving the read request, the service selects a target query service from the multiple query services in the system to handle the request based on the load balancing strategy, and then forwards the read request to the selected target query service.

[0126] In implementation, the load balancing service running on the upper layer of each query service and the load balancing service running on the upper layer of each storage service can be the same or different load balancing services. When they are the same load balancing service, the load balancing service is responsible for detecting the access of both write and read interface requests, selecting the target storage service or target query service based on the corresponding load balancing strategy, and forwarding the interface requests based on the selection.

[0127] After receiving the forwarded read request, the target query service first determines whether the user is a registered user with data stored in the cloud, based on the user identifier carried in the read request and the information recorded by the target query service itself based on listening to the configuration center (at least including the user identifier read from the configuration center).

[0128] If it is determined that the user is a registered user with data stored in the cloud, then, if the target query service only records the user identifier based on its monitoring of the configuration center, it further uses the user identifier and the description information of the second target data to be queried (such as the corresponding file and / or folder name) carried in the read request to match the corresponding item from the configuration center, thereby determining the storage path of the second target data in the configuration center. Then, it reads the second target data required by the user from the corresponding storage path in the configuration center (a logical layer location under the hierarchical storage architecture of cloud files) and provides feedback to the user. Alternatively, if the target query service has established and stored corresponding matching rules based on its monitoring of the configuration center, it can directly perform the required information matching within the target query service itself, thereby enabling the query and retrieval of the second target data required by the user in the configuration center.

[0129] If it is determined that the user is an unregistered user (has not registered with the cloud storage service system), the target query service will discard the received read request.

[0130] In this embodiment, since each storage service and each query service in the cloud storage service system achieves data sharing and corresponding response processing of the central control service by monitoring the data of the predetermined path of the configuration center, the goal of data consistency, task awareness and behavior matching between the services is achieved when the services in the system are running in a stateless manner.

[0131] Optionally, in one embodiment, see [link to relevant documentation]. Figure 7 The cross-service data sharing method disclosed in this application may further include the following processing:

[0132] Step 104: When there is a need to expand the service, create a new service based on the image file of the target service.

[0133] The target service here can be the first service and / or the second service in the service system (such as storage service or query service).

[0134] To cope with the huge fluctuations in cloud traffic between peak and off-peak periods, cloud service systems are typically required to have high elastic scaling capabilities. When it is necessary to scale up a target service to cope with peak traffic, the service can be created based on the image file of that target service.

[0135] Specifically, cloud services are generally deployed in containers. If a service needs to be scaled up, the service's image file can be automatically pulled and the pulled image file can be restarted in the container to achieve the creation and scaling of the service.

[0136] Step 105: The newly created service establishes a communication connection with the configuration center to write data information to the configuration center or share data from the configuration center based on listening to the configuration center.

[0137] After a newly created service starts, it automatically establishes a communication connection with the configuration center. Depending on actual needs, it can perform functions such as writing, modifying, listening to, and reading data from the configuration center. This allows it to write data to the configuration center (and subsequently share it with other services in the system), or share data from the configuration center based on listening to it. See [link to details] for more information. Figure 8 The provided cross-service data sharing system architecture is designed to expand service capacity.

[0138] When cloud traffic enters a low period, it is necessary to scale down the services accordingly. At this time, simply disconnect the connection between the corresponding services (such as some storage services or some query services) and the configuration center, and stop the operation of these services.

[0139] Because the service is rebuilt based on the image file of the existing service during the expansion, and a data connection is automatically established with the configuration center for data interaction after the new service is started, the running data of the expanded service is consistent with the running data of the original service on which the expansion is based. Furthermore, since the services in the system run statelessly, neither adding nor stopping a service will affect other services in the system.

[0140] Corresponding to the aforementioned cross-service data sharing method, this application also discloses a cross-service data sharing system, wherein, in Figure 9 This illustrates one possible structural composition of the system, specifically including:

[0141] Configuration center 91 and service system 92; service system 92 includes a first service 921 and at least one second service 922, wherein:

[0142] The first service 921 is used to write the data information to be shared into the configuration center 91;

[0143] At least one second service 922, for:

[0144] Monitor data changes in configuration center 91;

[0145] If the above data information is detected being written to configuration center 91, at least a portion of the data information is obtained, and corresponding response processing is performed based on the obtained at least a portion of the data.

[0146] In an optional embodiment of this application, the first service 921 is specifically used for:

[0147] Write the data to be shared to the predetermined path in Configuration Center 91;

[0148] When monitoring data changes in configuration center 91, the second service 922 is specifically used to monitor data changes under a predetermined path in configuration center 91.

[0149] In an optional embodiment of this application, the service system 92 further includes:

[0150] The third service is used to create a new service based on the image file of the target service when there is a need to expand the service.

[0151] The target service is the first service and / or the second service mentioned above; the newly created service establishes a communication connection with the configuration center 91 to write data information to the configuration center 91 or to share data from the configuration center 91 based on listening to the configuration center 91.

[0152] In one optional embodiment of this application, the service system 92 is a cloud storage service system deployed in the cloud for providing cloud data storage and query services;

[0153] The aforementioned at least one second service 922 includes at least one storage service and at least one query service.

[0154] In an optional embodiment of this application, the cross-service data sharing system further includes a storage center for data storage;

[0155] The aforementioned data information includes: user identifier, description information of the first target data to be stored by the user, and the target storage path in the storage center indicated for the first target data;

[0156] At least one storage service is used to obtain data information when it detects data being written to the configuration center 91, and to establish a data transmission channel with the user based on the user identifier in the data information.

[0157] At least one query service is used to obtain the user identifier from the data information when the configuration center 91 is monitored for writing data information, and to record the record result.

[0158] In an optional embodiment of this application, when the above-mentioned at least one query service obtains the user identifier from the data information and performs recording processing, it is specifically used for:

[0159] Obtain the user identifier from the data and record it.

[0160] Alternatively, retrieve all data from the data information and record it.

[0161] In an optional embodiment of this application, if there are multiple storage services, the target storage service among the multiple storage services is further used for:

[0162] Receive a write request from a user instructing the writing of the first target data; and write the first target data to the corresponding location in the storage center according to the target storage path and the description information described above.

[0163] The aforementioned target storage service is a service selected from multiple storage services based on the first strategy.

[0164] In an optional embodiment of this application, if there are multiple query services, the target query service among the multiple query services is further used for:

[0165] Receive the user's read request indicating that the second target data should be read; and based on the above-mentioned record results, query the second target data from the storage center and provide feedback to the user;

[0166] The target query service is the service selected from multiple query services based on the second strategy.

[0167] The cross-service data sharing system disclosed in this application is described simply because it corresponds to the cross-service data sharing method disclosed in the corresponding method embodiments above. For related similarities, please refer to the description of the target tracking method section in the method embodiments above, which will not be detailed here.

[0168] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referenced to each other.

[0169] For ease of description, the above systems or devices are described separately as various modules or units based on their functions. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware components.

[0170] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0171] Finally, it should be noted that in this document, relational terms such as first, second, third, and fourth are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0172] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A cross-service data sharing method, characterized in that, The method is applied to a cross-service data sharing system, the cross-service data sharing system comprising: a configuration center and a service system; the service system comprising a first service and at least one second service; the method comprising: The first service writes the data information to be shared into the configuration center; The at least one second service monitors data changes in the configuration center; If the at least one second service detects that the data information is written to the configuration center, the at least one second service obtains at least a portion of the data information and performs corresponding response processing based on the obtained at least a portion of the data; In the case where the service system is a cloud storage service system deployed in the cloud for providing cloud data storage and query services, the at least one second service includes at least one storage service and at least one query service, and the corresponding response processing includes: the storage service establishing a data transmission channel with the user to receive the user's data to be stored, and the query service recording information to update the matching rules when querying data.

2. The method according to claim 1, characterized in that, The first service writes the data information to be shared into the configuration center, including: The first service writes the data information to be shared into a predetermined path in the configuration center; The at least one second service monitors data changes in the configuration center, including: the at least one second service monitors data changes under the predetermined path in the configuration center.

3. The method according to claim 1, characterized in that, Also includes: When there is a need to expand service capacity, create a new service based on the image file of the target service. The newly established service establishes a communication connection with the configuration center to write data information to the configuration center or share data from the configuration center based on listening to the configuration center; The target service is the first service and / or the second service.

4. The method according to claim 1, characterized in that, The cross-service data sharing system also includes a storage center; The data information includes: user identifier, description information of the first target data to be stored by the user, and the target storage path indicated for the first target data in the storage center; The at least one second service acquires at least a portion of the data information and performs corresponding response processing based on the acquired at least a portion of the data, including: The at least one storage service obtains the data information and establishes a data transmission channel with the user based on the user identifier in the data information; The at least one query service obtains the user identifier from the data information and performs recording processing to obtain the recording result.

5. The method according to claim 4, characterized in that, The at least one query service obtains and records the user identifier from the data information, including: The at least one query service obtains the user identifier from the data information and performs recording processing; Alternatively, the at least one query service may retrieve all data from the data information and perform recording processing.

6. The method according to claim 4 or 5, characterized in that, If there are multiple storage services, after at least one storage service establishes a data transmission channel with the user, the method further includes: The target storage service among multiple storage services receives a write request from the user instructing the writing of the first target data; and writes the first target data to the corresponding location in the storage center according to the target storage path and the description information; The target storage service is a service selected from the plurality of storage services based on a first strategy.

7. The method according to claim 4 or 5, characterized in that, If there are multiple query services, after at least one query service obtains the user identifier from the data information and performs recording processing to obtain the recording result, the process further includes: The target query service among the multiple query services receives a user's read request indicating the need to read second target data; and based on the recorded results, queries the second target data from the storage center and provides feedback to the user; The target query service is a service selected from the plurality of query services based on a second strategy.

8. A cross-service data sharing system, characterized in that, include: Configuration center and service system; the service system includes a first service and at least one second service, wherein: The first service is used to write the data information to be shared into the configuration center; The at least one second service is used for: Monitor data changes in the configuration center; If the data information is detected being written to the configuration center, at least a portion of the data information is obtained, and corresponding response processing is performed based on the obtained at least a portion of the data. In the case where the service system is a cloud storage service system deployed in the cloud for providing cloud data storage and query services, the at least one second service includes at least one storage service and at least one query service, and the corresponding response processing includes: the storage service establishing a data transmission channel with the user to receive the user's data to be stored, and the query service recording information to update the matching rules when querying data.

9. The system according to claim 8, characterized in that, The first service is specifically used for: Write the data to be shared to the predetermined path in the configuration center; When the second service is monitoring data changes in the configuration center, it is specifically used to monitor data changes under the predetermined path in the configuration center.

10. The system according to claim 8, characterized in that, The service system also includes: The third service is used to create a new service based on the image file of the target service when there is a need to expand the service. The target service is the first service and / or the second service; the newly created service establishes a communication connection with the configuration center to write data information to the configuration center or share data from the configuration center based on listening to the configuration center.

11. The system according to claim 8, characterized in that, Also includes: Storage centers used for data storage; The data information includes: user identifier, description information of the first target data to be stored by the user, and the target storage path indicated for the first target data in the storage center; The at least one storage service is used to obtain the data information when it is detected that the data information is written to the configuration center, and to establish a data transmission channel with the user based on the user identifier in the data information; The at least one query service is used to, when it detects that the data information is being written to the configuration center, at least obtain the user identifier in the data information and perform recording processing to obtain the recording result.

12. The system according to claim 11, characterized in that, When the at least one query service obtains the user identifier from the data information and performs record processing, it is specifically used for: Obtain the user identifier from the data information and record it; Alternatively, all data in the data information can be obtained and recorded.

13. The system according to claim 11 or 12, characterized in that, If there are multiple storage services, the target storage service among the multiple storage services is also used for: Receive a write request from a user instructing the writing of the first target data; and write the first target data to the corresponding location in the storage center according to the target storage path and the description information; The target storage service is a service selected from the plurality of storage services based on a first strategy.

14. The system according to claim 11 or 12, characterized in that, If there are multiple query services, the target query service among the multiple query services is also used for: Receive a user's read request indicating the need to read second target data; and based on the recorded results, query the second target data from the storage center and provide feedback to the user; The target query service is a service selected from the plurality of query services based on a second strategy.

Citation Information

Patent Citations

  • Semantic resource publishing system and method and natural language processing device and method

    CN111368242A

  • Government affair cloud platform micro-service configuration method

    CN112187923A