Business data validation method, computer equipment and storage medium
By sending and detecting the reception status of service data in parallel, it ensures that atomic effect is carried out in service micro-applications, solving the problems of low efficiency and atomic effect of service data in the prior art, and achieving efficient and reliable data synchronization.
Patent Information
- Application Number
- CN202311188893.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-14
- Publication Date
- 2025-03-14
AI Technical Summary
The prior art is less efficient when synchronizing business data, and cannot guarantee the atomicity of business data in business micro-applications.
By obtaining the set of business data or files to be effective, it is sent in parallel to each business micro-application in the target service micro-application or distributed system. After the detection data is successfully received, the effective instructions are sent to ensure that all data is successfully received and effective in the target application.
It improves the efficiency of business data synchronization, and ensures the atomicity of business data in business micro-applications, avoiding business configuration errors caused by the failure of some data to take effect.
Smart Images

Figure CN119621838A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of business data technology, and in particular to a business data validation method, computer equipment and storage medium. Background Art
[0002] After configuring the business data according to the business needs, the configured business data needs to be synchronized to the corresponding business micro-applications to take effect. At present, the synchronization of business data is generally achieved by directly using ETL (Extract, transform, load) data warehouse technology, but because the amount of business data that needs to be synchronized is often large and the types of business data are various, the synchronization efficiency of business data is low, and the atomicity of business data in business micro-applications cannot be guaranteed to take effect.
[0003] Therefore, the existing business data validation solutions have the technical problems of low efficiency and inability to ensure atomic validation. Summary of the invention
[0004] The present application provides a business data validation method, a computer device and a storage medium, aiming to improve the efficiency of business data validation and ensure atomic validation.
[0005] On the one hand, the present application provides a method for validating business data, which includes: obtaining a set of business data to be validated; merging the business data and sending them to a target business micro-application; detecting whether each business data in the business data set is successfully received by the target business micro-application; if each business data in the business data set is successfully received by the target business micro-application, sending a validation instruction for the business data set to the target business micro-application, so that the target business micro-application performs data validation processing based on the business data set.
[0006] On the other hand, the present application provides a method for validating business data, the method comprising: obtaining a business data file to be validated; uploading the business data file to a preset server; sending a download instruction for the business data file to each business micro-application in the target distributed system, so that each business micro-application downloads the business data file from the preset server; detecting whether each business micro-application has successfully downloaded the business data file; after detecting that each business micro-application has successfully downloaded the business data file, sending a validation instruction for the business data file to each business micro-application, so that each business micro-application performs data validation processing based on the business data file.
[0007] On the other hand, the present application provides a business data validation device, which includes: a first acquisition unit, used to acquire a set of business data to be validated; a data sending unit, used to merge and send the business data to a target business micro-application; a first detection unit, used to detect whether each business data in the business data set is successfully received by the target business micro-application; a first validation unit, used to send a validation instruction for the business data set to the target business micro-application if each business data in the business data set is successfully received by the target business micro-application, so that the target business micro-application performs data validation processing based on the business data set.
[0008] On the other hand, the present application provides a business data validation device, which includes: a second acquisition unit, used to acquire the business data file to be validated; a data upload unit, used to upload the business data file to a preset server; sending a download instruction for the business data file to each business micro-application in the target distributed system, so that each business micro-application downloads the business data file from the preset server; a second detection unit, used to detect whether each of the business micro-applications has successfully downloaded the business data file; a second validation unit, used to send a validation instruction for the business data file to each of the business micro-applications after detecting that each of the business micro-applications has successfully downloaded the business data file, so that each of the business micro-applications performs data validation processing based on the business data file.
[0009] On the other hand, the present application also provides a computer device, comprising: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps in the above-mentioned method for validating business data.
[0010] On the other hand, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the steps in the above-mentioned method for validating business data.
[0011] The embodiments of the present application provide a method for validating business data, a computer device, and a storage medium, and the method for validating business data includes: obtaining a set of business data to be validated; merging the business data and sending it to a target business micro-application; detecting whether each business data in the business data set is successfully received by the target business micro-application; if each business data in the business data set is successfully received by the target business micro-application, sending a validation instruction for the business data set to the target business micro-application, so that the target business micro-application performs data validation processing based on the business data set. The present application not only improves the synchronization efficiency of the business data set, but also ensures the atomic validation of the business data set by sending the business data set to the target business micro-application in parallel, and only performs data validation processing when each business data in the business data set is successfully received by the target business micro-application. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0013] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0014] Figure 2 This is a flowchart of an embodiment of a method for validating business data provided in an embodiment of the present application;
[0015] Figure 3 This is another application scenario schematic diagram provided by an embodiment of the present application;
[0016] Figure 4 This is another example flow chart of the method for validating business data provided in the embodiments of the present application;
[0017] Figure 5 It is a schematic diagram of the structure of an embodiment of a device for validating business data provided in an embodiment of the present application;
[0018] Figure 6 It is a schematic diagram of the structure of another embodiment of the device for validating business data provided in the embodiments of the present application;
[0019] Figure 7 It is a schematic diagram of the structure of an embodiment of a computer device provided in the embodiments of the present application. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 those skilled in the art without creative work are within the scope of protection of this application.
[0021] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "plurality" means two or more, unless otherwise clearly and specifically defined.
[0022] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0023] The embodiments of the present application provide a method for validating business data, a computer device, and a storage medium, which are described in detail below.
[0024] like Figure 1 As shown, Figure 1 is a schematic diagram of an application scenario provided by an embodiment of the present application. The application scenario may include a computer device 10, in which a validation device for business data is integrated, such as Figure 1 The computer device 10 in.
[0025] In the embodiment of the present application, the computer device 10 may be a terminal or a server. When the computer device 10 is a server, it may be an independent server, or a server network or server cluster composed of servers. For example, the computer device 10 described in the embodiment of the present application includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server constructed by a plurality of servers. The cloud server is constructed by a large number of computers or network servers based on cloud computing.
[0026] It is understandable that when the computer device 10 in the embodiment of the present application is a terminal, the terminal used may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. Such a device may include: a cellular or other communication device having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The specific computer device 10 may be a desktop terminal or a mobile terminal, and the computer device 10 may also be one of a mobile phone, a tablet computer, a laptop computer, a medical auxiliary instrument, etc.
[0027] Those skilled in the art will understand that Figure 1 The application environment shown in the figure is only an example of the application scenario of the present application and does not constitute a limitation on the application scenario of the present application. Other application environments may also include Figure 1 More or less computer equipment as shown in Figure 1 Only one computer device is shown in the figure. It can be understood that the application scenario may also include one or more other computer devices, which are not specifically limited here.
[0028] In addition, if Figure 1 As shown, the application scenario may also include a target business micro-application 20 for receiving a business data set sent by the computer device 10 and providing corresponding business functions based on the business data set.
[0029] It should be noted that Figure 1 The application scenario diagram shown is merely an example and does not constitute a limitation on the technical solution provided in the embodiments of the present application. A person skilled in the art may appreciate that, with the evolution of application scenarios and the emergence of new business scenarios, the technical solution provided in the embodiments of the present application is also applicable to similar technical problems.
[0030] Next, a method for validating business data provided in an embodiment of the present application is introduced. The method for validating business data is implemented for a single target business micro-application.
[0031] In the embodiment of the business data validation method of the embodiment of the present application, the business data validation device is used as the execution subject. For the sake of simplicity and ease of description, the execution subject will be omitted in the subsequent method embodiments, and the business data validation device is applied to a computer device.
[0032] See also Figure 2 , Figure 2 The following is a flow chart of an embodiment of a method for validating business data provided in an embodiment of the present application. The method for validating business data includes:
[0033] 201. Obtain a set of business data to be effective;
[0034] In an embodiment of the present application, the business data set to be implemented can be manually configured based on actual business needs. After the business data set is manually configured, it can be used as the business data set to be implemented after approval. The business data set to be implemented includes multiple business data to be implemented. Taking the express fee surcharge business in the logistics field as an example, the multiple business data to be implemented can be the surcharge conditions and surcharge prices for multiple different express flows. Taking the express time extension business in the logistics field as an example, the multiple business data to be implemented can be the time extension conditions and time extension duration for multiple different express flows.
[0035] 202. Send the business data set merged row to the target business micro application;
[0036] In the embodiments of the present application, parallel transmission refers to transmitting the service data sets in groups on multiple parallel channels at the same time, thereby increasing the transmission speed of the service data sets.
[0037] The target business micro-application is a micro-application for providing business functions. The business functions provided by the target business micro-application match the business data set. Taking the business data set as the data set related to the express fee increase business as an example, the target business micro-application can be a micro-application that provides the express fee increase function. Taking the business data set as the data set related to the express time extension business as an example, the target business micro-application can be a micro-application that provides the express time extension function.
[0038] In some embodiments of the present application, merging and sending business data to a target business micro-application may include: performing data slicing processing on the business data set to obtain multiple data fragments, and the data slicing processing may be implemented by a task scheduling system such as Saturn; sending multiple data fragments in parallel to the target business micro-application. Among them, sending multiple data fragments in parallel to the target business micro-application specifically first sends multiple data fragments in parallel to a preset message middleware, and then the message middleware transmits the multiple data fragments to the target business micro-application, and the preset message middleware may be kafka. The operation of the message middleware transmitting multiple data fragments to the target business micro-application adopts a data idempotent design to ensure that the impact of executing the same operation any multiple times is the same as the impact of executing the operation once.
[0039] In some embodiments of the present application, in the process of sending the merged row of business data to the target business micro-application, the task of sending the business data set in parallel may be interrupted due to network anomalies and other problems. In view of this situation, a breakpoint-resume function of a business data set is provided to improve the stability of the synchronization of the business data set. Specifically, after sending the merged row of business data to the target business micro-application, it may also include: detecting whether the sending of the merged row of business data fails; if it is detected that the sending of the merged row of business data fails, obtaining the second business data in the business data set that has been successfully received by the target business micro-application, and multiple second business data may exist at the same time; determining the position of the second business data in the business data set, for example, when the business data set includes 10 business data, the positions of the multiple second business data in the business data set are respectively the 1st business data to the 5th business data in the business data set; based on the position of the second business data in the business data set, determining the breakpoint-resume position of the business data set, wherein the closest position in the business data set can be The next position of the second business data after the first business data is used as the breakpoint resume position of the business data set. For example, when the positions of multiple second business data in the business data set are the first business data to the fifth business data in the business data set, the next position is the position of the sixth business data. Therefore, the position of the sixth business data in the business data set can be used as the breakpoint resume position of the business data set. Based on the breakpoint resume position of the business data set, the business data set is processed for breakpoint resume, so that the business data set is completely sent to the target business micro-application in parallel. Taking the breakpoint resume position as the sixth business data in the business data set as an example, the breakpoint resume processing is performed from the position of the sixth business data in the business data set. The breakpoint resume processing can be implemented through task scheduling systems such as Saturn.
[0040] 203. Detect whether each business data in the business data set is successfully received by the target business micro application;
[0041] In an embodiment of the present application, in the process of merging and sending business data sets to a target business micro-application, due to network anomalies and other problems, the target business micro-application may not successfully receive some data fragments in the business data set. Therefore, in order to ensure the atomicity of the business data set, it is necessary to detect whether each business data in the business data set has been successfully received by the target business micro-application based on the business data dimension.
[0042] In some embodiments of the present application, the target business micro-application is provided with a message callback mechanism, that is, after each piece of business data is received, a corresponding first callback message will be fed back, so it can be determined whether each business data in the business data set is successfully received by the target business micro-application based on the first callback message fed back by the target business micro-application. Specifically, detecting whether each business data in the business data set is successfully received by the target business micro-application may include: after the business data are merged and sent to the target business micro-application, receiving the first callback message fed back by the target business micro-application; obtaining the business data identifier in the first callback message, the business data identifier is generally a UUID (Universally Unique Identifier), and a business data identifier is a unique identifier of a business data; among the multiple business data in the business data set, determining the first business data with the business data identifier; determining that the first business data is successfully received by the target business micro-application, and changing the state of the first business data from pending to be sent to successfully sent. Based on the state of each business data in the business data set, it can be determined whether each business data in the business data set is successfully received by the target business micro-application. If there is business data in the business data set that has not been determined to be successfully received, it means that not all business data in the business data set have been successfully received by the target business micro-application.
[0043] In some embodiments of the present application, a function of visualizing the sending progress of a business data set is provided. Specifically, after detecting whether each business data in the business data set is successfully received by the target business micro-application, it can also include: in the business data set, determining the number of business data successfully received by the target business micro-application, the number of business data is the number of business data; determining the total number of business data in the business data set, that is, the total number of business data included in the business data set; based on the number of business data and the total number of business data, determining the sending progress of the business data set, for example, the sending progress of the business data set can be the percentage of the number of business data and the total number of business data; outputting the sending progress of the business data set, for example, the sending progress of the business data set can be displayed on a display screen to realize the visualization of the sending progress of the business data set. Among them, when determining the number of business data successfully received by the target business micro-application and the total number of business data in the business data set, it is necessary to ensure that it is thread-safe (that is, it is necessary to ensure that the calculated number of business data and the total number of business data are correct).
[0044] 204. If all business data in the business data set are successfully received by the target business micro-application, a validation instruction for the business data set is sent to the target business micro-application, so that the target business micro-application performs data validation processing based on the business data set.
[0045] In an embodiment of the present application, if each business data in a business data set is successfully received by a target business micro-application, a step of data validation can be performed to avoid a part of the business data not being successfully received by the target business micro-application, but another part of the business data has been effective, thereby causing a business configuration error in the target business micro-application. In the step of performing data validation, specifically, a validation instruction for the business data set is sent to the target business micro-application, so that the target business micro-application performs data validation processing based on the business data set. Data validation processing generally refers to refreshing the business configuration information of the target business micro-application based on the business data set, so that the business data set is applied in the target business micro-application.
[0046] In some embodiments of the present application, since there may be conflicts between different business data, for example, one business data is: the surcharge price for the express flow from city A to city B is 5 yuan, and the other business data is: the surcharge price for the express flow from city A to city B is 10 yuan, it is necessary to restrict the order of effectiveness of the business data that may conflict, so as to avoid the business data configuration error in the target business micro application. Specifically, before sending the effectiveness instruction for the business data set to the target business micro application, it can also include: obtaining multiple third business data belonging to the same business in the business data set, wherein each business data is generally provided with a business key, and the business key is used to identify the uniqueness of different businesses, so multiple business data with the same business key can be used as multiple third business data; determining the order of configuration between multiple third business data, the order of configuration, that is, the order of manually configuring multiple third business data, can be obtained by sorting based on the configuration time of multiple third business data; based on the order of configuration, generating an effective instruction for the business data set, wherein the effective instruction for the business data set includes the order of configuration between multiple third business data. In this way, when the target business micro-application receives the effectiveness instruction for the business data set, it will also perform data effectiveness processing on the multiple third business data in the business data set in sequence according to the configuration order between the multiple third business data, so as to avoid the third business data configured earlier overwriting the third business data configured later, which will cause the business data configuration errors in the target business micro-application.
[0047] The business data validation method provided in the embodiment of the present application sends the business data set to the target business micro-application in parallel, and only performs data validation processing when each business data in the business data set is successfully received by the target business micro-application. This not only improves the synchronization efficiency of the business data set when facing a large amount of business data set, but also ensures the atomic validation of the business data set.
[0048] like Figure 3 As shown, Figure 3is another application scenario diagram provided by an embodiment of the present application. The application scenario may include a computer device 10, in which a validation device for business data is integrated, such as Figure 3 The computer device 10 in.
[0049] like Figure 3 As shown, the application scenario may also include a preset server 30 for storing business data files uploaded by the computer device 10 .
[0050] like Figure 3 As shown, the application scenario may also include a target distributed system, which includes multiple business micro-applications, such as Figure 3 The business micro-application 40, business micro-application 50, business micro-application 60, etc., each business micro-application is used to download a business data file from a preset server 30 and provide a corresponding business function based on the business data file.
[0051] It should be noted that Figure 3 The application scenario diagram shown is merely an example and does not constitute a limitation on the technical solution provided in the embodiments of the present application. A person skilled in the art may appreciate that, with the evolution of application scenarios and the emergence of new business scenarios, the technical solution provided in the embodiments of the present application is also applicable to similar technical problems.
[0052] Next, another method for validating business data provided by an embodiment of the present application is introduced. The method for validating business data is implemented for multiple business micro-applications in a target distributed system.
[0053] In the embodiment of the business data validation method of the embodiment of the present application, the business data validation device is used as the execution subject. For the sake of simplicity and ease of description, the execution subject will be omitted in the subsequent method embodiments, and the business data validation device is applied to a computer device.
[0054] See also Figure 4 , Figure 4 This is a flow chart of another embodiment of the method for validating business data provided in the embodiments of the present application. The method for validating business data includes:
[0055] 401. Obtain the business data file to be effective;
[0056] In the embodiment of the present application, the business data file to be effective can be manually configured based on actual business needs. The business data file to be effective includes multiple business data to be effective, and the multiple business data can belong to different business types, such as express product business, express time extension business, express fee surcharge business, etc.
[0057] The business data file to be effective is generally in the form of a single file. For example, the business data file to be effective can be a single compressed package, which is obtained by compressing multiple business data to be effective, so as to facilitate the upload of multiple business data to be effective. Specifically, obtaining the business data file to be effective can include: obtaining business data of multiple business types to be effective, and the business data of each business type is used to take effect in a business micro-application, such as the business data of the express time extension service is used to take effect in the micro-application of the express time extension service; based on the business data of multiple business types to be effective, a business data file is generated, for example, the multiple business data to be effective can be compressed to obtain a business data file in the form of a compressed package. In this way, each business micro-application can extract the business data of the business type that is effective in the business micro-application from the business data file, and perform data effectiveness processing. For example, when the business micro-application is a micro-application for express fee surcharge service, the business micro-application can extract the business data of the express fee surcharge service from the business data file, and then perform data effectiveness processing based on the business data of the express fee surcharge service. For another example, when the business micro-application is a micro-application for express delivery time-limited service, the business micro-application can extract the business data of the express delivery time-limited service from the business data file, and then perform data validation based on the business data of the express delivery time-limited service. In the business data file, each business data is provided with an identifier of the corresponding business category, so that based on the identifier, the business data of the business category that is effective in the business micro-application is extracted from the business data file, so that the validation method of the business data can be applied to the business data of each business category, which facilitates the subsequent expansion of business categories.
[0058] 402. Upload the business data file to the preset server;
[0059] In an embodiment of the present application, the preset server may be a cloud server for storage such as OSS (Object Storage Service). After uploading the business data file to the preset server, the storage address of the business data file in the preset server may be obtained, so as to facilitate subsequent downloading of the business data file at the storage address.
[0060] 403. Send a download instruction of the business data file to each business micro-application in the target distributed system, so that each business micro-application downloads the business data file from the preset server;
[0061] In an embodiment of the present application, the target distributed system includes multiple business micro-applications. Taking the target distributed system as a distributed system for logistics services as an example, the distributed system for logistics services includes micro-applications for express product services, micro-applications for express time extension services, micro-applications for express fee surcharge services, etc. Through the coordination of the business functions of multiple business micro-applications, complete logistics services are provided to users.
[0062] The download instruction for sending the business data file includes the storage address of the business data file in the preset server. In this way, after sending the download instruction for the business data file to each business micro-application in the target distributed system, each business micro-application can download the business data file from the preset server based on the storage address, avoiding the business data validation device sending the business data file to each business micro-application separately, thereby improving the synchronization efficiency of the business data file. The download instruction for the business data file can be sent to each business micro-application through a preset message middleware, and the preset message middleware can be kafka.
[0063] 404. Check whether each business micro-application has successfully downloaded the business data file;
[0064] In an embodiment of the present application, during the process of each business micro-application downloading business data files, due to network anomalies and other problems, some business micro-applications may not successfully download the business data files. Therefore, in order to ensure the atomicity of the business data files, it is necessary to detect whether each business micro-application has successfully downloaded the business data files based on the dimension of the business micro-application.
[0065] In some embodiments of the present application, each business micro-application is provided with a message callback mechanism, that is, after receiving the download instruction of the business data file and successfully downloading the business data file from the preset server, the corresponding second callback message will be fed back, so it can be determined whether each business micro-application has successfully downloaded the business data file based on the second callback message fed back by each business micro-application. Specifically, detecting whether each business micro-application has successfully downloaded the business data file may include: after sending the download instruction of the business data file to each business micro-application, judging whether the second callback message fed back by each business micro-application is received, the second callback message includes the file identifier of the business data file; based on whether the second callback message fed back by each business micro-application is received, judging whether each business micro-application has successfully downloaded the business data file, for example, when receiving the second callback message fed back by a certain business micro-application, judging that the business micro-application has successfully downloaded the business data file, and when not receiving the second callback message fed back by a certain business micro-application, judging that the business micro-application has not successfully downloaded the business data file. In addition, for the case where a new business micro-application is added, based on the message callback mechanism in the new business micro-application, the effectiveness of the business data in the new business micro-application can be realized, and it can be seen that the effectiveness method of the business data has high expansibility.
[0066] 405. After detecting that each business micro-application has successfully downloaded the business data file, a validation instruction for the business data file is sent to each business micro-application, so that each business micro-application performs data validation processing based on the business data file.
[0067] In an embodiment of the present application, if each business micro-application successfully downloads a business data file, a step of data validation can be performed to avoid a part of the business micro-applications not successfully downloading the business data file, but another part of the business micro-applications have been effective for the business data file, thereby making the business configuration errors between different business micro-applications. In the step of data validation, specifically, a validation instruction for the business data file is sent to each business micro-application, so that each business micro-application performs data validation processing based on the business data file. The validation instruction for the business data file can be sent to each business micro-application through a preset message middleware, and the preset message middleware can be kafka.
[0068] The business data validation method provided in the embodiment of the present application improves the business data synchronization efficiency for multiple business micro-applications, ensures the atomic validation of business data in multiple business micro-applications, and improves the stability and reliability of multiple business micro-applications in the target distributed system.
[0069] In order to better implement the method for validating business data in the embodiment of the present application, based on the method for validating business data, a device for validating business data is also provided in the embodiment of the present application, such as Figure 5 As shown, the business data validation device 500 includes: a first acquisition unit 501, used to acquire the business data set to be validated; a data sending unit 502, used to merge the business data and send them to the target business micro-application; a first detection unit 503, used to detect whether each business data in the business data set is successfully received by the target business micro-application; a first validation unit 504, used to send a validation instruction for the business data set to the target business micro-application if each business data in the business data set is successfully received by the target business micro-application, so that the target business micro-application performs data validation processing based on the business data set.
[0070] The business data validation device provided in the embodiment of the present application sends the business data set to the target business micro-application in parallel, and only performs data validation processing when each business data in the business data set is successfully received by the target business micro-application. This not only improves the synchronization efficiency of the business data set, but also ensures the atomic validation of the business data set.
[0071] In order to better implement the method for validating business data in the embodiment of the present application, based on the method for validating business data, a device for validating business data is also provided in the embodiment of the present application, such as Figure 6 As shown, the business data validation device 600 includes: a second acquisition unit 601, used to acquire the business data file to be validated; a data upload unit 602, used to upload the business data file to a preset server; sending a download instruction of the business data file to each business micro-application in the target distributed system, so that each business micro-application downloads the business data file from the preset server; a second detection unit 603, used to detect whether each business micro-application has successfully downloaded the business data file; a second validation unit 604, used to send a validation instruction for the business data file to each business micro-application after detecting that each business micro-application has successfully downloaded the business data file, so that each business micro-application performs data validation processing based on the business data file.
[0072] The business data validation device provided in the embodiment of the present application uploads the business data file to be validated to a preset server, and after each business micro-application has successfully downloaded the business data file, each business micro-application performs data validation processing based on the business data file, thereby improving the business data synchronization efficiency for multiple business micro-applications and ensuring the atomic validation of business data in multiple business micro-applications.
[0073] In addition to the above-mentioned methods and devices for validating business data, the embodiments of the present application also provide a computer device, which integrates any one of the business data validation devices provided in the embodiments of the present application, and the computer device includes: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and are configured to be executed by the processor in any one of the steps in the above-mentioned embodiments of the method for validating business data.
[0074] The present application also provides a computer device that integrates any one of the service data validation devices provided in the present application. Figure 7 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:
[0075] The computer device may include one or more processing core processors 701, one or more computer readable storage medium storage units 702, a power supply 703, an input unit 704 and other components. Those skilled in the art will understand that Figure 7 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0076] The processor 701 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the storage unit 702 and calling data stored in the storage unit 702, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 701.
[0077] The storage unit 702 can be used to store software programs and modules. The processor 701 executes various functional applications and data processing by running the software programs and modules stored in the storage unit 702. The storage unit 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the storage unit 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the storage unit 702 may also include a memory controller to provide the processor 701 with access to the storage unit 702.
[0078] The computer device also includes a power supply 703 for supplying power to various components. Preferably, the power supply 703 can be logically connected to the processor 701 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 703 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0079] The computer device may further include an input unit 704, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0080] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in the embodiment of the present application, the processor 701 in the computer device will load the executable file corresponding to the process of one or more applications into the storage unit 702 according to the following instructions, and the processor 701 will run the application stored in the storage unit 702, thereby realizing various functions, as follows: obtaining a set of business data to be effective; merging the business data and sending it to the target business micro-application; detecting whether each business data in the business data set is successfully received by the target business micro-application; if each business data in the business data set is successfully received by the target business micro-application, sending an effective instruction for the business data set to the target business micro-application, so that the target business micro-application performs data effectiveness processing based on the business data set.
[0081] The business data validation method provided in the embodiment of the present application sends the business data set to the target business micro-application in parallel, and only performs data validation processing when each business data in the business data set is successfully received by the target business micro-application. This not only improves the synchronization efficiency of the business data set, but also ensures the atomic validation of the business data set.
[0082] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. The computer-readable storage medium stores a plurality of instructions, which can be loaded by a processor to execute the steps in any one of the business data validation methods provided in the embodiment of the present application. For example, the instruction may execute the following steps: obtaining a business data set to be validated; merging the business data into rows and sending them to a target business micro-application; detecting whether each business data in the business data set is successfully received by the target business micro-application; if each business data in the business data set is successfully received by the target business micro-application, sending a validation instruction for the business data set to the target business micro-application, so that the target business micro-application performs data validation processing based on the business data set.
[0083] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0084] The above is a detailed introduction to a method for validating business data, a computer device and a storage medium provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. The content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for validating business data, characterized in that: The method comprises: Get the business data set to be effective; Send the business data merge rows to the target business micro application; Detect whether each business data in the business data set is successfully received by the target business micro application; If each business data in the business data set is successfully received by the target business micro-application, a validation instruction for the business data set is sent to the target business micro-application, so that the target business micro-application performs data validation processing based on the business data set.
2. The method for validating business data according to claim 1, characterized in that: The detecting whether each business data in the business data set is successfully received by the target business micro-application includes: After the business data are merged and sent to the target business micro application, a first callback message fed back by the target business micro application is received; Obtaining the service data identifier in the first callback message; Determine, among the plurality of business data in the business data set, first business data having the business data identifier; It is determined whether the first business data is successfully received by the target business micro-application to determine whether each of the business data in the business data set is successfully received by the target business micro-application.
3. The method for validating business data according to claim 1, characterized in that: After detecting whether each business data in the business data set is successfully received by the target business micro-application, the method further includes: In the business data set, determine the amount of business data successfully received by the target business micro application; Determining the total amount of business data in the business data set; Determining a sending progress of the service data set based on the amount of the service data and the total amount of the service data; Output the sending progress of the business data set.
4. The method for validating business data according to claim 1, characterized in that: After the business data is merged and sent to the target business micro application, the method further includes: If it is detected that the business data set fails to be sent in a combined row, obtaining second business data in the business data set that has been successfully received by the target business micro-application; Determining a position of the second service data in the service data set; Determining a breakpoint resume transmission position of the business data set based on a position of the second business data in the business data set; Based on the breakpoint resume position of the business data set, the business data set is processed by breakpoint resume to merge the business data set and send it to the target business micro application.
5. The method for validating business data according to claim 1, characterized in that: Before sending the validation instruction for the business data set to the target business micro-application, the method further includes: Acquire multiple third business data belonging to the same business in the business data set; Determining a configuration order among the plurality of third service data; Based on the configuration sequence, a validation instruction is generated for the business data set, so that the target business micro-application performs data validation processing on the multiple third business data in the business data set in sequence according to the configuration sequence.
6. A method for validating business data, characterized in that: The method comprises: Obtain the business data file to be effective; Uploading the business data file to a preset server; Sending a download instruction of the business data file to each business micro-application in the target distributed system, so that each business micro-application downloads the business data file from the preset server; Detect whether each of the business micro-applications has successfully downloaded the business data file; After detecting that each of the business micro-applications has successfully downloaded the business data file, a validation instruction for the business data file is sent to each of the business micro-applications, so that each of the business micro-applications performs data validation processing based on the business data file.
7. The method for validating business data according to claim 6, characterized in that: The obtaining of the business data file to be effective includes: Acquire business data of multiple business categories to be effective, wherein the business data of each business category is used to take effect in one of the business micro-applications; Based on the business data of the multiple business types to be effective, the business data file is generated so that each business micro-application can extract the business data of the business type effective in the business micro-application from the business data file and perform the data effectiveness processing.
8. The method for validating business data according to claim 6, characterized in that: The detecting whether each of the business micro-applications has successfully downloaded the business data file includes: After sending the download instruction of the business data file to each business micro-application, determining whether a second callback message fed back by each business micro-application is received; Based on whether the second callback message fed back by each of the business micro-applications is received, it is determined whether each of the business micro-applications has successfully downloaded the business data file.
9. A computer device, characterized in that: The computer device comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and are configured to be executed by the processor to implement the steps in the business data validation method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the method for validating business data according to any one of claims 1 to 8.