Data processing method and device, equipment and storage medium
By dyeing users, distinguishing test data from production data, the problem that testers use production data to affect user experience is solved, ensuring the accuracy of data processing and the stability of the production environment.
Patent Information
- Application Number
- CN202310658430.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-05
- Publication Date
- 2024-12-06
AI Technical Summary
After the business is released, when testers use production data from the production environment for testing, it is easy for users to see the data modified during the test, affecting the user experience, and may lead to instability in the production environment.
By obtaining the user's parameter information, dyeing the user based on pre-configured dyeing rules, determining whether the user is a test user or a formal user, and returning the corresponding data based on the corresponding data set to ensure the distinction between the test data and the production data.
It realizes the color of the user when receiving the user request, so as to accurately return data matching the user, preventing the user experience and production environment stability during the testing process.
Smart Images

Figure CN119088844A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, equipment and storage medium. Background Art
[0002] In the process of launching a business, there are usually production environments and test environments for the business to be released. The test environment is usually the environment used by developers in the process of developing and testing the business, and test data in the test environment will be generated. The production environment is the environment where external services are officially provided after the business is released and launched. When users use the business in the production environment, production data will be generated.
[0003] After a service is released, it is usually necessary to test and improve the service. Under normal circumstances, it is necessary to ensure that testers use test data to test and improve the service. If testers use production data in the production environment for testing, if the production data is modified during the test, users who use the service will also see the test data, causing instability in the production environment and affecting the user experience of using the service. Summary of the invention
[0004] In view of this, the present application provides a data processing method, apparatus, device and storage medium to more accurately return data to corresponding users.
[0005] To achieve the above objectives, the technical solutions provided by this application are as follows:
[0006] In a first aspect of the present application, a method for processing data is provided, the method comprising:
[0007] In response to a request from a first user to obtain target data, obtaining parameter information of the first user;
[0008] Coloring the parameter information of the first user based on a coloring rule to obtain the coloring information of the first user, wherein the coloring rule includes a corresponding relationship between the parameter information and the coloring information;
[0009] Based on the identifiers of each data set in the database, obtaining a target identifier that matches the dyeing information of the first user;
[0010] The target data is obtained from the data set corresponding to the target identifier based on the request, and the target data is sent to the first user.
[0011] In a possible implementation, the coloring information includes a coloring identifier, the coloring identifier includes a valid flag bit and an invalid flag bit, the coloring rule includes a parameter information set corresponding to the coloring identifier, and coloring the parameter information of the first user based on the coloring rule to obtain the coloring information of the first user includes:
[0012] Matching the parameter information of the first user with the parameter information set;
[0013] When the parameter information of the first user belongs to the parameter information set, a valid flag of the coloring identifier is added to the parameter information of the first user; otherwise, an invalid flag of the coloring identifier is added to the parameter information of the first user to obtain the coloring information of the first user.
[0014] In a possible implementation, the process of determining the identifier includes:
[0015] In response to a request from a second user to write data, acquiring parameter information of the second user;
[0016] Coloring the parameter information of the second user based on the coloring rule to obtain coloring information of the second user;
[0017] The identification is determined for the data written by the second user based on the coloring information of the second user.
[0018] In a possible implementation, the coloring information of the second user includes a valid flag bit of the coloring identifier or an invalid flag bit of the coloring identifier, the valid flag bit of the coloring identifier corresponds to the valid flag bit of the identifier, and the invalid flag bit of the coloring identifier corresponds to the invalid flag bit of the identifier.
[0019] In a possible implementation, the data in each data set has an identifier and a field ID, the request includes the field ID of the target data, and obtaining the target data in the data set corresponding to the target identifier based on the request includes:
[0020] Based on the field ID of each data in the data set corresponding to the target identifier, searching for a target field ID that matches the field ID of the target data;
[0021] The data corresponding to the target field ID is determined to be the target data.
[0022] In a possible implementation, the method further includes:
[0023] When the parameter information of the first user cannot be obtained, allocating a uniform resource identifier URI to the first user based on the request;
[0024] Acquire a data set corresponding to the URI based on a pre-configured URI configuration rule, wherein the URI configuration rule includes a corresponding relationship between the URI and the data set;
[0025] The target data is obtained from the data set corresponding to the URI based on the request, and the target data is sent to the first user.
[0026] In a possible implementation, the method further includes:
[0027] When the dyeing information of the first user cannot be obtained, determining the service environment in which the request is located;
[0028] Acquire a data set corresponding to the service environment, wherein the service environment and the data set have a corresponding relationship;
[0029] The target data is acquired from the data set corresponding to the service environment based on the request, and the target data is sent to the first user.
[0030] In a possible implementation manner, the parameter information includes: at least one of a user identifier and a device identifier.
[0031] In a second aspect of the present application, a data processing device is provided, the device comprising:
[0032] A first acquiring unit, configured to acquire parameter information of a first user in response to a request from the first user to acquire target data;
[0033] a coloring unit, configured to color the parameter information of the first user based on a coloring rule to obtain the coloring information of the first user, wherein the coloring rule includes a corresponding relationship between the parameter information and the coloring information;
[0034] A second acquisition unit, configured to acquire a target identifier that matches the dyeing information of the first user based on identifiers of each data set in the database;
[0035] A third acquisition unit is configured to acquire the target data from the data set corresponding to the target identifier based on the request, and send the target data to the first user.
[0036] In a possible implementation, the coloring information includes a coloring identifier, the coloring identifier includes a valid flag and an invalid flag, the coloring rule includes a parameter information set corresponding to the coloring identifier, and the coloring unit is specifically used to match the parameter information of the first user with the parameter information set; when the parameter information of the first user belongs to the parameter information set, the valid flag of the coloring identifier is added to the parameter information of the first user, otherwise, the invalid flag of the coloring identifier is added to the information of the first parameter user to obtain the coloring information of the first user.
[0037] In one possible implementation, the process of determining the identifier includes: in response to a request from a second user to write data, obtaining parameter information of the second user; coloring the parameter information of the second user based on the coloring rule to obtain coloring information of the second user; and determining the identifier for the data written by the second user based on the coloring information of the second user.
[0038] In a possible implementation, the coloring information of the second user includes a valid flag bit of the coloring identifier or an invalid flag bit of the coloring identifier, the valid flag bit of the coloring identifier corresponds to the valid flag bit of the identifier, and the invalid flag bit of the coloring identifier corresponds to the invalid flag bit of the identifier.
[0039] In a possible implementation, the data in each data set has an identifier and a field ID, the request includes the field ID of the target data, and the third acquisition unit is specifically used to find the target field ID that matches the field ID of the target data based on the field ID of each data in the data set corresponding to the target identifier; and determine that the data corresponding to the target field ID is the target data.
[0040] In a possible implementation, the device further includes: an allocating unit;
[0041] The allocating unit is configured to allocate a uniform resource identifier URI to the first user based on the request when the parameter information of the first user cannot be obtained;
[0042] The second acquisition unit is further used to acquire a data set corresponding to the URI based on a pre-configured URI configuration rule, wherein the URI configuration rule includes a corresponding relationship between the URI and the data set;
[0043] The third acquisition unit is further configured to acquire the target data from the data set corresponding to the URI based on the request, and send the target data to the first user.
[0044] In a possible implementation manner, the device further includes: a determining unit;
[0045] The determining unit is configured to determine the service environment in which the request is located when the dyeing information of the first user cannot be obtained;
[0046] The second acquisition unit is further used to acquire a data set corresponding to the service environment, and the service environment and the data set have a corresponding relationship;
[0047] The third acquisition unit is further configured to acquire the target data from the data set corresponding to the service environment based on the request, and send the target data to the first user.
[0048] In a third aspect of the present application, an electronic device is provided, the device comprising: a processor and a memory;
[0049] The memory is used to store instructions or computer programs;
[0050] The processor is used to execute the instructions or computer programs in the memory so that the electronic device executes the method described in the first aspect above.
[0051] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a device, the device executes the method described in the first aspect above.
[0052] In a fifth aspect of the present application, a computer program product is provided, wherein the computer program product comprises a computer program / instructions, and when the computer program / instructions are executed by a processor, the method described in the first aspect is implemented.
[0053] It can be seen that this application has the following beneficial effects:
[0054] In the above implementation of the present application, when a request from the first user to obtain target data is received, the parameter information of the first user, such as the user ID and the device ID used by the user, etc., can be obtained first. In order to achieve user coloring, coloring rules can be pre-configured, that is, the parameter information of different users and the corresponding coloring information. Then the parameter information of the first user can be colored based on the coloring rules to obtain the coloring information of the first user. The data set in the database predetermines the corresponding identifier, and the target identifier matching the coloring information of the first user can be obtained according to the identifier of each data set. Based on the request of the first user, the target data is obtained in the data set corresponding to the target identifier, and the target data is sent to the first user. Through the data processing method provided above, the user can be colored when the user's request is received, so that according to the user's coloring information, the data matching the coloring information is returned to the user in the data with the identifier, so that the corresponding data can be accurately returned to the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 An architectural diagram of a data processing device provided in an embodiment of the present application;
[0057] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;
[0058] Figure 3 A flowchart of determining a data set of a first user provided in an embodiment of the present application;
[0059] Figure 4 A schematic diagram of a data processing device provided in an embodiment of the present application;
[0060] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0062] After a service is released, testers usually need to test and improve the service. Under normal circumstances, testers use test data to test and improve the service, so that when the test data is modified, it will not be displayed in the production environment, that is, it will not affect the normal use of the service by users. If the tester uses production data for testing, if the production data is modified during the test process, users who use the service will also see the data modified during the test process, resulting in instability of the service in the production environment and affecting the user experience of using the service.
[0063] Based on this, an embodiment of the present application provides a data processing method to accurately return the corresponding data to the user. In specific implementation, when a request from the first user to obtain target data is received, the parameter information of the first user, such as the user identifier and the device identifier used by the user, etc., can be obtained first. In order to achieve user coloring, the coloring rules can be pre-configured, that is, the parameter information of different users and the corresponding coloring information. Then the parameter information of the first user can be colored based on the coloring rules to obtain the coloring information of the first user. The data set in the database predetermines the corresponding identifier, and the target identifier matching the coloring information of the first user can be obtained according to the identifier of each data set. Based on the request of the first user, the target data is obtained in the data set corresponding to the target identifier, and the target data is sent to the first user. Through the data processing method provided above, the user traffic can be colored when the user's request is received, so that according to the user's coloring information, the data matching the coloring information is returned to the user in the data with the identifier, so that the corresponding data can be accurately returned to the user.
[0064] The method can be executed by a data processing device, which can be a terminal or a server. The terminal includes but is not limited to a desktop, a laptop, a tablet computer and a smart phone. The server can be a cloud server in a cloud environment, such as a central server in a central cloud computing cluster, or an edge server in an edge cloud computing cluster. Of course, the server can also be a server in a local data center, and the so-called local data center refers to the data center to which the user belongs. It should also be noted that the server can be a single server or a server cluster formed by multiple servers.
[0065] Optionally, the method provided in this embodiment can be applied in a test environment and a production environment, that is, by coloring the user, it is determined whether the user is a test user or a formal user, and then corresponding data is returned to the user, preventing the test user from mistakenly using the formal data of the production environment during the test process, thereby affecting the normal use of the business.
[0066] In this embodiment, different data sets in the database have corresponding identifiers, which are predetermined according to the coloring information of the user who writes the data, and can be used to distinguish between test data and formal data. And each data in the data set has a corresponding field ID, which can represent the ID corresponding to different types of services. Since each business needs to be tested and can be used normally, the data in the test environment and the production environment may have the same field ID. Therefore, when determining the target data obtained by the user, it is necessary to first determine whether it is a test environment or a production environment based on the identifier of the data set in the database, and then uniquely determine the target data based on the field ID of each data, and send the target data to the first user.
[0067] The following describes the process of allocating user traffic to determine data identification using a specific application scenario. Figure 1 , Figure 1 An architectural diagram of a data processing device provided in an embodiment of the present application.
[0068] The system architecture of the data processing device can be divided into basic services, access layer services (upstream services) and downstream services. Among them, the basic service can determine whether the data input by the user is data that needs to be tested. For example, the data that needs to be tested can be a data processing request for developing new functions. The basic service can distribute user data to the access layer service. The access layer service may include production services and test services, corresponding to the production environment and the test environment respectively. When the user data is data that needs to be tested, it can be directly distributed to the test service in the access layer service, and then a test identifier is added to the user data. When the user data is distributed to the production service, it can also be determined whether the user is a test user. If it is a test user, a test identifier is added to the user data. If it is not a test user, a formal identifier is added to the user data. Then the access layer service distributes it to the downstream service, for example, the data processing task of the database. The database of the downstream service includes the formal data generated by the production environment and the test data generated by the test environment. When the user data has a test identifier, the data in the user data that needs to be written to the database is distributed to the test data in the test environment of the downstream service. When the user data has a formal identifier, the data in the user data that needs to be written to the database is distributed to the formal data in the production environment of the downstream service, thereby determining the identifiers of different data and the data sets corresponding to different identifiers.
[0069] In order to more clearly understand the technical solution provided by the embodiments of the present application, a detailed introduction will be given below with reference to the accompanying drawings.
[0070] See also Figure 2 , Figure 2 A flowchart of a data processing method provided in an embodiment of the present application.
[0071] The method may include the following steps:
[0072] S201: In response to a request from a first user to obtain target data, parameter information of the first user is obtained.
[0073] The data processing device may receive a request from a first user to obtain target data, so as to obtain the target data from a database and send it to the user. Each data written into the database has a field ID, so when the data processing device generates a request to obtain target data, it may generate a field ID of the target data for screening and determining the target data. That is, all data stored in the database have a field ID, so that the target data required by the user may be found in the database according to the field ID of the target data.
[0074] Since different data sets may include data with the same field ID, it is necessary to first color the user to determine the data set corresponding to the user. Specifically, when receiving a request from the first user, the data processing device can obtain parameter information of the first user, wherein the parameter information may include a user identifier of the first user, a device identifier of the first user, etc. The user identifier may be a user name, a user ID, etc., and the device identifier may be a device ID used by the first user, etc. Subsequently, the user traffic is distinguished by coloring the first user.
[0075] S202: Coloring the parameter information of the first user based on the coloring rule to obtain the coloring information of the first user.
[0076] The coloring rules may be pre-configured in the data processing device. The coloring rules may include the correspondence between the parameter information and the coloring information. For example, the coloring information may be represented by a coloring identifier, and the parameter information of different users satisfies different conditions and corresponds to different coloring identifiers. That is, when the user identifier and the device identifier are different, different coloring information may be corresponding. Then, coloring is performed based on the coloring rules satisfied by the parameter information of the first user, thereby obtaining the coloring information of the first user.
[0077] In a possible implementation, the coloring information may include a coloring identifier, wherein the coloring identifier may include a valid flag bit and an invalid flag bit. That is, the flag bit of the coloring identifier is used to distinguish the coloring traffic corresponding to different users. The flag bit may be represented by a string or a numerical value, for example, it may be represented by "1", and the invalid flag bit may be represented by "0", which is not limited in this embodiment.
[0078] When determining the coloring rule, the parameter information set corresponding to the coloring identifier can be determined in advance, and then the parameter information set can be used to color the user's parameter information. Specifically, this can be achieved in the following way: the parameter information of the first user is matched with the parameter information set to determine whether the parameter information belongs to the parameter information set. When the parameter information of the first user belongs to the parameter information set, a valid flag bit of the coloring identifier is added to the parameter information of the first user; otherwise, an invalid flag bit of the coloring identifier is added to the parameter information of the first user to obtain the coloring information of the first user.
[0079] For ease of understanding, an application scenario will be described below. In this application scenario, the coloring rules configured in the embodiment of the present application can be used to color users to determine whether the user is a test user or a formal user. Among them, the test user is a person who develops and tests the service, and the formal user is a person who normally uses the service.
[0080] Optionally, the parameter information set may be configured to include all user identifiers corresponding to the test user and all device identifiers corresponding to the test user. After obtaining the parameter information of the first user, i.e., the user identifier, device identifier, etc. of the first user, the user identifier and device identifier of the first user may be matched with all user identifiers and all device identifiers included in the parameter information set. If at least one of the user identifier and device identifier of the first user belongs to the parameter information set, a valid flag bit of the dye identifier may be added to the parameter information of the first user, indicating that the first user is a test user; if neither the user identifier nor the device identifier of the first user belongs to the parameter information set, an invalid flag bit of the dye identifier may be added to the parameter information of the first user, indicating that the first user is a formal user.
[0081] In the above embodiment, different dyeing information is distinguished by adding a valid flag bit and an invalid flag bit of a dyeing identifier. Optionally, different dyeing information can also be distinguished by adding different dyeing identifiers. For example, the dyeing information can be set to include a second dyeing identifier and a third dyeing identifier, and the dyeing rule includes a first parameter information set corresponding to the first dyeing identifier and a second parameter information set corresponding to the second dyeing identifier. The first dyeing identifier and the second dyeing identifier can be added by adding an identification field, and the first dyeing identifier and the second dyeing identifier correspond to different identification fields.
[0082] When coloring the parameter information of the first user, the parameter information of the first user is matched with the first parameter information set and the second parameter information set; when the parameter information of the first user belongs to the first parameter information set, a first coloring identifier is added to the parameter information of the first user; when the parameter information of the first user belongs to the second parameter information set, a second coloring identifier is added to the parameter information of the first user, thereby obtaining the coloring information of the first user.
[0083] Optionally, only the first parameter information set corresponding to the first coloring identifier may be set in the coloring rule. When the parameter information of the first user is colored, the parameter information of the first user is matched with the first parameter information set. When the parameter information of the first user belongs to the first parameter information set, the first coloring identifier is added to the parameter information of the first user. When the parameter information of the first user does not belong to the first parameter information set, the second coloring identifier is added to the parameter information of the first user, thereby obtaining the coloring information of the first user.
[0084] S203: Based on the identifiers of each data set in the database, obtain a target identifier that matches the dyeing information of the first user.
[0085] The data in each data set in the database has a corresponding identifier, which is predetermined according to the coloring information of the user who wrote the data. When the first user wants to obtain the target data, it is necessary to determine the target identifier that matches the coloring information of the first user according to the coloring information of the first user, so as to obtain the target data in the data set corresponding to the target identifier.
[0086] In order to facilitate understanding of the principle of obtaining target data, the process of determining the identifier of a data set in a database will be specifically introduced below.
[0087] The data in the database is stored in the database when different users write data. When the data processing device receives a request from the second user to write data, it can first obtain the parameter information of the second user, and then use the pre-configured coloring rules to color the parameter information of the second user to obtain the coloring information of the second user, thereby determining the identification of the data written by the second user according to the coloring information of the second user. It should be noted that the specific process of coloring the second user to determine the coloring information can refer to the process of coloring the first user, which will not be repeated here.
[0088] The identifier of the data written by the second user corresponds to the dyeing information of the second user, and the corresponding relationship between the data identifier and the dyeing information of the second user is predetermined. For example, when the dyeing information of the second user includes a valid flag bit of the dyeing identifier or an invalid flag bit of the dyeing identifier, the valid flag bit of the dyeing identifier can be set to correspond to the valid flag bit of the data identifier, and the invalid flag bit of the dyeing identifier can be set to correspond to the invalid flag bit of the data identifier, so that the corresponding relationship between the dyeing identifier and the data identifier can be determined.
[0089] Taking the application scenario in the above embodiment as an example, when a valid flag with a coloring mark is added to the parameter information of the second user, it indicates that the second user is a test user. At this time, a valid flag with a mark can be added to the data written by the second user, indicating that the data written by the second user is test data; when an invalid flag with a coloring mark is added to the parameter information of the second user, it indicates that the second user is a formal user. At this time, an invalid flag with a mark can be added to the data written by the second user, indicating that the data written by the second user is formal data.
[0090] After determining the identifier of each data, the data belonging to the same identifier can be taken as a data set, so that the data sets corresponding to different identifiers can be determined. When writing new data, the data can be stored in the corresponding data set according to the identifier of the data. After determining the dyeing information of the first user, since the dyeing information of the first user includes a valid flag bit or an invalid flag bit of the dyeing identifier, the target identifier of the data set corresponding to the dyeing identifier (the dyeing information of the first user) can be determined in the identifiers corresponding to each data set based on the correspondence between the dyeing identifier of the first user and the identifier of the data set.
[0091] S204: Acquire target data from the data set corresponding to the target identifier based on the request, and send the target data to the first user.
[0092] Since each data has a field ID when the user writes data, and the data processing device can also generate a field ID corresponding to the target data when generating a request for the first user to obtain the target data, after determining the data set corresponding to the target identifier, the field ID of the target data can be searched in the field IDs of each data in the data set to obtain the field ID, thereby determining that the data corresponding to the found field ID is the target data, and then the data processing device can send the obtained target data to the first user.
[0093] Through the data processing method provided in the above embodiment, user traffic can be colored when a user request is received, so that according to the user's coloring information, data matching the coloring information can be returned to the user in a data set with an identifier, thereby achieving accurate return of corresponding data to the user.
[0094] The above embodiment introduces a method for coloring users according to their parameter information to obtain target data. In one possible implementation, when the data processing device processes the request of the first user in an asynchronous scenario, it may not be able to obtain the parameter information of the first user. At this time, the data processing device can allocate a corresponding uniform resource identifier (URI) to the first user according to the request of the first user to obtain the target data.
[0095] Among them, URI is a string used to identify a resource. Different URIs correspond to different resources when users access them. This type of identification allows users to interact with any resource (including local and Internet) through a specific protocol. Every resource available on the Web, such as HTML documents, images, videos, programs, etc., can be located by a URI.
[0096] Different URI configuration rules can be pre-configured in the data processing device, wherein the URI configuration rules include the correspondence between URI and data set, that is, each URI corresponds to a corresponding data set. For example, a first URI set corresponding to the formal data set, a second URI set corresponding to the test data set, and a third URI set corresponding to all data sets can be configured. Therefore, after the URI is assigned to the first user, the data set corresponding to the URI of the first user can be determined according to the different URIs included in the URI configuration rules, and then the target data is obtained in the data set according to the request of the first user, and the target data is sent to the first user. For example, when the URI of the first user belongs to the first URI set, the formal data set corresponding to the first URI set is obtained; when the URI of the first user belongs to the second URI set, the test data set corresponding to the second URI set is obtained; when the URI of the first user belongs to the third URI set, all data sets corresponding to the third URI set, that is, the formal data set and the test data set, are obtained. In addition, in the URI sets corresponding to different data sets, the URI isolation levels configured for different data processing devices can also be set. That is, when the data processing device is configured with a separate URI isolation level, the URI set that satisfies the URI isolation level configured by the data processing device can be determined, thereby obtaining the data set corresponding to the URI set.
[0097] It should be noted that the URI configuration rules provided in the above embodiment are only exemplary descriptions, and the correspondence between URI and data set is not limited to the above implementation method.
[0098] After the data processing device has dyed the parameter information of the first user, the dyeing information of the first user is determined. When the data processing device subsequently processes the data in the database to obtain the target data, it is necessary to first obtain the dyeing information of the first user. In one possible implementation, the data processing device may not be able to obtain the dyeing information of the first user. For example, the data processing device fails to successfully dye the parameter information of the first user due to some faults, or the dyeing information after successful dyeing is not transmitted to subsequent data processing tasks. At this time, the data processing device can determine the service environment in which the first user's request is located. For example, Figure 1 The access layer services shown include production services and test services, and it can be determined whether the request of the first user to access is in production service or test service. The data processing device can pre-configure data sets corresponding to different service environments. For example, when in the production service environment, the formal data set can be obtained, and when in the test environment, the test data set or the entire data set can be obtained. Therefore, after determining the service environment in which the request of the first user is located, the data set corresponding to the service environment can be obtained according to the correspondence between the pre-configured service environment and the data set, and the target data can be obtained in the data set according to the request of the first user, so as to send the target data to the first user.
[0099] It should be noted that the correspondence between different service environments and data sets can be set according to actual needs, and this embodiment does not limit this.
[0100] In a possible implementation, configuration rules for different data processing devices can also be configured in advance in the dynamic configuration center, that is, the configuration rules include data sets corresponding to different data processing devices. In this way, when the data processing device receives the user's request, it obtains the configuration rules of the dynamic configuration center and determines whether the current data processing device exists in the dynamic configuration center. If it does, there is no need to color the user, and the data set corresponding to the data processing device can be obtained, and then the target data is determined in the data set. If it does not exist, the steps provided in the above embodiment are processed to obtain the target data required by the first user.
[0101] In a possible implementation, when the corresponding data set cannot be obtained based on all the above steps, the predetermined data set may be returned to the data processing device so that the data processing device obtains the target data of the first user from the data set.
[0102] Based on the above method embodiment, the present application embodiment provides a method for determining a data set of a first user. Figure 3 , Figure 3 A flowchart of determining a data set of a first user is provided in an embodiment of the present application.
[0103] The method may include the following steps:
[0104] S301: Obtain configuration rules of a dynamic configuration center;
[0105] S302: Determine whether the current data processing device exists in the configuration rule;
[0106] S303: If yes, obtain the data set corresponding to the current data processing device;
[0107] S304: Otherwise, determine whether the parameter information of the first user can be obtained;
[0108] S305: If yes, color the parameter information of the first user based on the coloring rule to obtain the coloring information of the first user; based on the identifiers of each data set in the database, obtain the data set corresponding to the target identifier that matches the coloring information of the first user;
[0109] S306: Otherwise, allocate a URI to the first user, and obtain a data set corresponding to the URI based on the URI configuration rule.
[0110] The specific implementation process can be found in the above embodiments, which will not be described in detail here.
[0111] Based on the above method embodiment, the present application embodiment further provides a data processing device, which will be described in detail below with reference to the accompanying drawings.
[0112] See also Figure 4 , Figure 4 A schematic diagram of a data processing device provided in an embodiment of the present application.
[0113] The apparatus 400 may include:
[0114] A first acquisition unit 401 is configured to acquire parameter information of a first user in response to a request from the first user to acquire target data;
[0115] A coloring unit 402 is used to color the parameter information of the first user based on a coloring rule to obtain the coloring information of the first user, wherein the coloring rule includes a correspondence between the parameter information and the coloring information;
[0116] A second acquisition unit 403 is used to acquire a target identifier that matches the dyeing information of the first user based on identifiers of each data set in the database;
[0117] The third acquisition unit 404 is configured to acquire the target data from the data set corresponding to the target identifier based on the request, and send the target data to the first user.
[0118] In a possible implementation, the coloring information includes a coloring identifier, the coloring identifier includes a valid flag and an invalid flag, the coloring rule includes a parameter information set corresponding to the coloring identifier, and the coloring unit 402 is specifically used to match the parameter information of the first user with the parameter information set; when the parameter information of the first user belongs to the parameter information set, the valid flag of the coloring identifier is added to the parameter information of the first user, otherwise, the invalid flag of the coloring identifier is added to the information of the first parameter user to obtain the coloring information of the first user.
[0119] In one possible implementation, the process of determining the identifier includes: in response to a request from a second user to write data, obtaining parameter information of the second user; coloring the parameter information of the second user based on the coloring rule to obtain coloring information of the second user; and determining the identifier for the data written by the second user based on the coloring information of the second user.
[0120] In a possible implementation, the coloring information of the second user includes a valid flag bit of the coloring identifier or an invalid flag bit of the coloring identifier, the valid flag bit of the coloring identifier corresponds to the valid flag bit of the identifier, and the invalid flag bit of the coloring identifier corresponds to the invalid flag bit of the identifier.
[0121] In a possible implementation, the data in each data set has an identifier and a field ID, the request includes the field ID of the target data, and the third acquisition unit 404 is specifically used to find the target field ID that matches the field ID of the target data based on the field ID of each data in the data set corresponding to the target identifier; and determine that the data corresponding to the target field ID is the target data.
[0122] In a possible implementation, the device further includes: an allocating unit;
[0123] The allocating unit is configured to allocate a uniform resource identifier URI to the first user based on the request when the parameter information of the first user cannot be obtained;
[0124] The second acquisition unit 403 is further configured to acquire a data set corresponding to the URI based on a pre-configured URI configuration rule, wherein the URI configuration rule includes a corresponding relationship between the URI and the data set;
[0125] The third acquisition unit 404 is further configured to acquire the target data from the data set corresponding to the URI based on the request, and send the target data to the first user.
[0126] In a possible implementation manner, the device further includes: a determining unit;
[0127] The determining unit is configured to determine the service environment in which the request is located when the dyeing information of the first user cannot be obtained;
[0128] The second acquisition unit 403 is further used to acquire a data set corresponding to the service environment, and the service environment and the data set have a corresponding relationship;
[0129] The third acquisition unit 404 is further configured to acquire the target data from the data set corresponding to the service environment based on the request, and send the target data to the first user.
[0130] The data processing device provided by the above embodiment can color the user traffic when receiving the user's request, so that according to the user's coloring information, data matching the coloring information can be returned to the user in a data set with an identifier, thereby achieving accurate return of corresponding data to the user.
[0131] It should be noted that the specific implementation of each unit in this embodiment can refer to the relevant description in the above method embodiment. The division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. The functional units in the embodiment of the present application can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. For example, in the above embodiment, the processing unit and the sending unit can be the same unit or different units. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0132] See also Figure 5 , which shows a schematic diagram of the structure of an electronic device 500 suitable for implementing the embodiment of the present application. The terminal device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0133] like Figure 5As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0134] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0135] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present application are executed.
[0136] The electronic device provided in the embodiment of the present application and the method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0137] An embodiment of the present application provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the method provided by the above embodiment is implemented.
[0138] It should be noted that the computer-readable medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0139] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0140] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0141] The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device can execute the method.
[0142] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0143] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0144] The units involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the unit / module does not, in some cases, constitute a limitation on the unit itself.
[0145] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0146] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0147] 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, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0148] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0149] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0150] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0151] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data processing method, characterized in that: The method comprises: In response to a request from a first user to obtain target data, obtaining parameter information of the first user; Coloring the parameter information of the first user based on a coloring rule to obtain the coloring information of the first user, wherein the coloring rule includes a corresponding relationship between the parameter information and the coloring information; Based on the identifiers of each data set in the database, obtaining a target identifier that matches the dyeing information of the first user; The target data is obtained from the data set corresponding to the target identifier based on the request, and the target data is sent to the first user.
2. The method according to claim 1, characterized in that The coloring information includes a coloring identifier, the coloring identifier includes a valid flag bit and an invalid flag bit, the coloring rule includes a parameter information set corresponding to the coloring identifier, and coloring the parameter information of the first user based on the coloring rule to obtain the coloring information of the first user includes: Matching the parameter information of the first user with the parameter information set; When the parameter information of the first user belongs to the parameter information set, a valid flag of the coloring identifier is added to the parameter information of the first user; otherwise, an invalid flag of the coloring identifier is added to the parameter information of the first user to obtain the coloring information of the first user.
3. The method according to claim 1, characterized in that The process of determining the identification includes: In response to a request from a second user to write data, acquiring parameter information of the second user; Coloring the parameter information of the second user based on the coloring rule to obtain coloring information of the second user; The identification is determined for the data written by the second user based on the coloring information of the second user.
4. The method according to claim 3, characterized in that The dyeing information of the second user includes a valid flag bit of the dyeing identification or an invalid flag bit of the dyeing identification, the valid flag bit of the dyeing identification corresponds to the valid flag bit of the identification, and the invalid flag bit of the dyeing identification corresponds to the invalid flag bit of the identification.
5. The method according to claim 1, characterized in that The data in each data set has an identifier and a field ID, the request includes the field ID of the target data, and obtaining the target data in the data set corresponding to the target identifier based on the request includes: Based on the field ID of each data in the data set corresponding to the target identifier, searching for a target field ID that matches the field ID of the target data; The data corresponding to the target field ID is determined to be the target data.
6. The method according to claim 1, characterized in that The method further comprises: When the parameter information of the first user cannot be obtained, allocating a uniform resource identifier URI to the first user based on the request; Acquire a data set corresponding to the URI based on a pre-configured URI configuration rule, wherein the URI configuration rule includes a corresponding relationship between the URI and the data set; The target data is obtained from the data set corresponding to the URI based on the request, and the target data is sent to the first user.
7. The method according to claim 1, characterized in that The method further comprises: When the dyeing information of the first user cannot be obtained, determining the service environment in which the request is located; Acquire a data set corresponding to the service environment, wherein the service environment and the data set have a corresponding relationship; The target data is acquired from the data set corresponding to the service environment based on the request, and the target data is sent to the first user.
8. A data processing device, characterized in that: The device comprises: A first acquisition unit, configured to acquire parameter information of a first user in response to a request from the first user to acquire target data; a coloring unit, configured to color the parameter information of the first user based on a coloring rule to obtain the coloring information of the first user, wherein the coloring rule includes a corresponding relationship between the parameter information and the coloring information; A second acquisition unit, configured to acquire a target identifier that matches the dyeing information of the first user based on identifiers of each data set in the database; A third acquisition unit is configured to acquire the target data from the data set corresponding to the target identifier based on the request, and send the target data to the first user.
9. An electronic device, characterized in that: The device comprises: a processor and a memory; The memory is used to store instructions or computer programs; The processor is used to execute the instructions or computer programs in the memory so that the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a device, the device executes the method according to any one of claims 1 to 7.
